Skip to content

Latest commit

 

History

History
197 lines (143 loc) · 6.73 KB

README.md

File metadata and controls

197 lines (143 loc) · 6.73 KB

My Personal Configuration Files

VIM Configuration

My very personal Vim configuration. I do Python and Go development at work on a daily basis. Also I need to read (more than writing) Javascript code (mostly ReactJS). My personal interests at the moment includes Clojure, Haskell, Rust and Scala programming languages to play on my free time. So this configuration supports these 7 languages. Except Clojure, all other language supports comes from corresponding Language Server. Some more details below.

  • Compatible with both Vim >=8 and Neovim.
  • Some plugins might not support vanilla Vim without compiled python3.
  • Recommended environment includes iTerm nightly and tmux.
  • Plugins managed by vim-plug.
  • Primary programming languages supported: Python, Clojure, Haskell, Rust, Go, Javascript and Scala.
  • Language support is available via corresponding Language Servers except for Clojure.
  • Mnemonic keyboard shortcuts. E.g. file based actions under <Leader>f and buffer based shortcuts are under <Leader>b.
  • Leader key is space.
  • Local leader is \.
  • I am using LanguageClient-neovim as autocompletion and language client engine. Except Clojure all completion and language server capabilities comes from LanguageClient.

Key bindings List

Notable custom key bindings;

  • File based operations (starts with <leader>f)
    • <leader>ff Find files. Fuzzy search UI populated with ripgrep. It simulteanously shows files, open buffers. You can switch between these with C-n and C-p.
    • <leader>fj Fuzzy find junkfiles.
    • <leader>ft Toggle tagbar.
    • <leader>fs Write buffer to disk. Equivalent to :w<cr>.
    • <leader>fW Remove trailing whitespace from whole buffer.
  • Buffer based operations (starts with <leader>b)
    • <leader>bb List open buffers and prompt with fuzzy search to jump.
    • <leader>bd Delete current buffer. Equivalent to :bd<cr>.
    • <leader><tab> Switch to previous buffer. Equivalent to :b#<cr>.
  • Search based operations
    • n mapped to nzzzv to keep matching line in the middle of the screen.
    • <leader>/ uses :grep! command to prompt and load results into quickfix list.
    • <leader>* uses :grep! command with word under cursor and load results into quickfix list.
    • <BS> executes :nohlsearch<cr>.
    • <leader>ss Populates (on the fly) all tags (outline) in the file. Plus all lines in the buffer will be in the list to narrow with fuzzy search. (ctags) into fuzzy search UI.
  • Other
    • <leader>V selects just pasted text.
  • Programming support bindings.
    • gd jump to definition of the symbol under cursor using language server or specific plugin.
    • K shows hover information using language server or specific plugin.
    • [c jump to next language server diagnostic message.
    • ]c jump to previous language server diagnostic message.
    • gy show type definition from language server.
    • gi show implementations from language server.
    • gr show references from language server.
    • <leader>rn use rename function from language server.

Check keybindings.vim for all custom keybindings. Filetype based keybindings (for haskell, python etc.) and configurations can be found in corresponding files under nvim/after/ftplugin directory.

Plugins List

Check plugins.vim for all plugins.

Installation

MacOS

  • Install Neovim (I prefer HEAD).

      $ brew install neovim --HEAD
    
  • For Neovim it is recommended to use separated virtual python environments for editor's own needs (I use Fish shell and virtualfish). For any shell, these virtual environments must be located under ~/.virtualenvs/.

      $ vf new neovim2
      $ vf new --python=python3 neovim3
    
  • Clone repository to any place you prefer.

      $ git clone https://github.com/zekzekus/dotfiles.git
    
  • Create symbolic links.

      $ cd $HOME
      $ cd .config
      $ ln -s /path/to/dotfiles/nvim .
    
  • Create necessary directories.

      $ cd $HOME
      $ mkdir .nvimtmp
    
  • First run will give errors. Ignore them.

      $ nvim
    
  • For each editor execute :PlugInstall command.

  • Install necessary OS packages.

      $ brew install ctags ripgrep the_silver_searcher fzf brew install tavianator/tap/bfs
    
  • Install Language Servers for the languages you want work on.

TMUX Configuration

Mac OS X

  • First install Homebrew

      /usr/bin/ruby -e "$(curl -fsSL
      https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  • Next, install the tmux and reattach-to-user-namespace packages using Homebrew

      brew install tmux brew install reattach-to-user-namespace
    
  • Create a symbolic link to dotfiles/tmux/tmux.conf

      ln -s /path/to/repo/dotfiles/tmux/tmux.conf ~/.tmux.conf
    
  • (Optional) Change the shell from fish to zsh
    • Open ~/.tmux.conf in your favorite editor and edit the MYSHELL and MYSHELL_PATH variables in the file which defaults to fish

        ...  3 # SHELL choice (zsh | fish) 4 MYSHELL=zsh 5
        MYSHELL_PATH=/usr/local/bin/zsh ...
      
  • Run tmux

    ~$ tmux

  • Et voilà!

Debian/Ubuntu

  • Install the xsel and tmux packages

      sudo apt-get install xsel tmux
    
  • Create a symbolic link to dotfiles/tmux/tmux.ubuntu.conf

      ln -s /path/to/repo/dotfiles/tmux/tmux.ubuntu.conf ~/.tmux.conf
    
  • (Optional) Change the shell from fish to zsh
    • Open ~/.tmux.conf in your favorite editor and edit the MYSHELL and MYSHELL_PATH variables in the file which defaults to fish

        ...  3 # SHELL choice (zsh | fish) 4 MYSHELL=zsh 5
        MYSHELL_PATH=/usr/bin/zsh ...
      
  • Run tmux

    ~$ tmux

  • Troubleshooting :

    • If you get an error regarding ambiguous option: mouse edit your ~/.tmux.conf and change the set -g mouse on to this

        # set -g mouse on
      
  • Et voilà!

ZSH Configuration

FISH Configuration

CTAGS

MACOSX