Advertisement
Guest User

Nvim Config

a guest
Jul 15th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. call plug#begin('~/.config/nvim/plugged')
  2.  
  3. Plug 'myusuf3/numbers.vim'
  4.  
  5. Plug 'vimwiki/vimwiki'
  6.  
  7. Plug 'ayu-theme/ayu-vim'
  8.  
  9. call plug#end()
  10.  
  11. " Nice terminal colours
  12. set termguicolors
  13.  
  14. let ayucolor="dark"
  15.  
  16. colorscheme ayu
  17.  
  18. " Set colour scheme
  19.  
  20. " Enable spellchecking
  21. set spelllang=en_gb
  22.  
  23. autocmd FileType markdown,vimwiki setlocal spell
  24.  
  25. " Enable line numbers
  26. set number
  27.  
  28. " Enable inccommand
  29. set inccommand=split
  30.  
  31. " Enable UTF-8
  32. set encoding=utf-8
  33.  
  34. " Set tab width
  35. set tabstop=4
  36. set shiftwidth=4
  37. set expandtab
  38.  
  39. " Enable syntax highlighting
  40. syntax on
  41.  
  42. " Remap semicolon to colon
  43. nnoremap ; :
  44.  
  45. " Switch between buffers easily
  46. nnoremap <S-n> :bprevious<CR>
  47. nnoremap <S-m> :bnext<CR>
  48.  
  49. " Easier buffer switching
  50. nnoremap <S-J> <C-W><C-J>
  51. nnoremap <S-K> <C-W><C-K>
  52. nnoremap <S-L> <C-W><C-L>
  53. nnoremap <S-H> <C-W><C-H>
  54.  
  55. " Exit from terminal mode easily
  56. tnoremap <Esc> <C-\><C-n>
  57.  
  58. " Set the leader
  59. let mapleader = "-"
  60.  
  61. " Toggle a todo with shift-d
  62. nnoremap <S-d> :VimwikiToggleListItem<CR>
  63.  
  64. " Open the vimwiki by default
  65. autocmd VimEnter * if argc() == 0 | execute 'VimwikiIndex' | endif
  66.  
  67. " Push the wiki to the git repo
  68. autocmd BufWritePost,FileWritePost *.wiki call PushWiki()
  69.  
  70. " A function to execute the commands
  71. function PushWiki()
  72. execute "cd ~/vimwiki"
  73.  
  74. execute "make"
  75. endfunction
  76.  
  77. command Config edit ~/.config/nvim/init.vim
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement