Skip to content

Instantly share code, notes, and snippets.

@kmpm
Last active May 28, 2025 06:22
Show Gist options
  • Save kmpm/5dc74b1e3367094805c54dd68c4f9842 to your computer and use it in GitHub Desktop.
Save kmpm/5dc74b1e3367094805c54dd68c4f9842 to your computer and use it in GitHub Desktop.
Neovim stuff

Useful stuff for neovim

Go

mkdir -p ~/.config/nvim
alias vimgo='nvim -u ~/.config/nvim/go_init.vim'
echo "alias vimgo='nvim -u ~/.config/nvim/go_init.vim'" >> ~/.profile

# install plug
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'


~/.config/nvim/go_init.vim

set expandtab
set shiftwidth=4
set tabstop=4
set hidden
set signcolumn=yes:2
" only set relativenumber if you prefer it
" set relativenumber
set number
set termguicolors
set undofile
set spell
set title
set ignorecase
set smartcase
set wildmode=longest:full,full
set nowrap
set list
set mouse=a
set scrolloff=8
set sidescrolloff=8
set nojoinspaces
set splitright
set clipboard=unnamedplus
set confirm
set exrc

call plug#begin('~/.vim/plugged')

" This is where we'll be adding the other plugins
  Plug 'fatih/vim-go'
  " needs node >14 for installation
  " Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
  Plug 'preservim/nerdtree'
  Plug 'nvim-lua/plenary.nvim'
  Plug 'NeogitOrg/neogit'

  Plug 'charlespascoe/vim-go-syntax'

call plug#end()

nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>

Remember to run :GoInstallBinaries after doing :PlugInstall.

Navigation and stuff

nerdtree

  • open nerdtree menu

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment