Note: Changes being made in this README are already there in the .vimrc file. No need to make it again.
Manages VIM plugins.
Commands to setup Pathogen
:
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Then add this to the .vimrc
:
execute pathogen#infect()
The installation of NERDTree was not done using pathogen. It was done manually.
mkdir -p ~/.vim/
cd /tmp/
curl -L -o nerdTree.6.10.9.zip https://github.com/preservim/nerdtree/archive/refs/tags/6.10.9.zip
unzip nerdTree.6.10.9.zip
mv nerdtree-6.10.9/* ~/.vim/
git clone https://github.com/preservim/nerdtree.git ~/.vim/bundle/nerdtree
This plugin is NodeJS extension host for vim.
cd ~/.vim/bundle
git clone https://github.com/natebosch/vim-lsc
That's all. If VIM Pathogen is installed and configured in the .vimrc
then it would be picked up.
.vimrc
already contains the necessay configuraion required to use it, however, a language server needs to be installed:
- Install gopls
$ GO111MODULE=on go get golang.org/x/tools/gopls@latest
- Update
.vimrc
to usegopls
for Go files
let g:lsc_server_commands = {'go': 'gopls'}
- Update
.vimrc
to configurevim-lsc
" Complete default mappings are:
let g:lsc_auto_map = {
\ 'GoToDefinition': 'gd',
\ 'GoToDefinitionSplit': ['<C-W>]', '<C-W><C-]>'],
\ 'FindReferences': 'gr',
\ 'NextReference': 'g<C-n>',
\ 'PreviousReference': 'g<C-p>',
\ 'FindImplementations': 'gi',
\ 'FindCodeActions': 'ga',
\ 'Rename': 'gR',
\ 'ShowHover': v:true,
\ 'DocumentSymbol': 'go',
\ 'WorkspaceSymbol': 'gS',
\ 'SignatureHelp': 'gm',
\ 'Completion': 'completefunc',
\}
- gd: For navigating to the function defintion
- gi: For navigating to the implementation
- gr: For navigation to the references
- K: To get the documemntation
- Code Completetion
File finder
cd ~/.vim/bundle
git clone https://github.com/kien/ctrlp.vim
That's all. If VIM Pathogen is installed tand configured in the .vimrc
then it would be picked up. To configure the shortcuts
add this in the .vimrc
:
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
The themes are present in the colors
directory:
~/code/dots/vim $ tree
.
├── colors
│ ├── monokai.vim
│ └── solarized.vim
└── README.md
1 directory, 3 files
To set the theme in vim, for example, monokai
, update the following config params in .vimrc
" Colorscheme
colorscheme monokai
syntax enable
set background=dark
# | Name | Source | Reference |
---|---|---|---|
1 | Monokai | → | → |
2 | Solarized | → | |
3 | Apprentice | → | → |
4 | Vim Monokai - Based on Sublime | → | |
5 | Photon | → | |
6 | Edge | → | |
7 | Sonokai | → |
Screenshot:
- :term For terminal
- C-\ then C-n For normal mode in terminal, i to go back to Terminal mode
- C-w then H, J, K, L to move the current split
- :vsp for vertical split
- g then T or t for tab navigation
- m on an entry in NERDTree list to get the options for actions
- Press o to open the file in a new buffer or open/close directory.
- Press t to open the file in a new tab.
- Press i to open the file in a new horizontal split.
- Press s to open the file in a new vertical split.
- Press p to go to parent directory.
- Press r to refresh the current directory.