Skip to content

Latest commit

 

History

History

vim

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Note: Changes being made in this README are already there in the .vimrc file. No need to make it again.

Table of Contents:

Manages VIM plugins.

Installation Steps

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.

Installation Steps

Without Pathogen
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/
With Pathogen
git clone https://github.com/preservim/nerdtree.git ~/.vim/bundle/nerdtree

Snapshots

  • NERDTree Setup image

This plugin is NodeJS extension host for vim.

Installation Steps

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:

Configuring LSP for Go

  • Install gopls
$ GO111MODULE=on go get golang.org/x/tools/gopls@latest
  • Update .vimrc to use gopls for Go files
let g:lsc_server_commands = {'go': 'gopls'}
  • Update .vimrc to configure vim-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',
    \}              

Shortcuts

  • gd: For navigating to the function defintion
  • gi: For navigating to the implementation
  • gr: For navigation to the references
  • K: To get the documemntation

Screenshots

  • Code Completetion

image

  • Function References (gr) image

  • Function Definition (K)

image

File finder

Installation Steps

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'

Screenshots

image

Themes

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

Favorite Themes

# Name Source Reference
1 Monokai
2 Solarized
3 Apprentice
4 Vim Monokai - Based on Sublime
5 Photon
6 Edge
7 Sonokai

Theme screenshot

image

Statusline Configuration

Screenshot:

image

Shortcuts to Remember

  • :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

:NERDTree shortcuts

  • 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.