Advertisement
Guest User

Untitled

a guest
Aug 26th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. " Plugins {{{
  2.  
  3. call plug#begin('~/.config/nvim/plugged')
  4.  
  5. Plug 'tpope/vim-sensible'
  6. Plug 'junegunn/seoul256.vim'
  7.  
  8. Plug 'vim-syntastic/syntastic'
  9.  
  10. Plug 'godlygeek/tabular' "must come before vim-markdown
  11. Plug 'plasticboy/vim-markdown'
  12. Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } }
  13.  
  14. Plug 'sheerun/vim-polyglot'
  15. Plug 'tpope/vim-surround'
  16. Plug 'scrooloose/nerdcommenter'
  17. Plug 'thaerkh/vim-indentguides'
  18. " Plug 'Yggdroot/indentLine'
  19.  
  20. call plug#end()
  21.  
  22. filetype plugin on
  23. filetype indent on
  24.  
  25. " }}}
  26.  
  27. " Look and feel of vim {{{
  28. let mapleader = ","
  29. set number
  30. " Unified color scheme (default: dark)
  31. colorscheme elflord
  32. " set background=dark
  33.  
  34. set pastetoggle=<C-P>
  35. " Copy and paste.
  36. set clipboard+=unmappedplus
  37.  
  38. " Copy to clipboard
  39. vnoremap <leader>y "+y
  40. nnoremap <leader>Y "+yg_
  41. nnoremap <leader>y "+y
  42. nnoremap <leader>yy "+yy
  43.  
  44. " Paste from clipboard
  45. nnoremap <leader>p "+p
  46. nnoremap <leader>P "+P
  47. vnoremap <leader>p "+p
  48. vnoremap <leader>P "+P
  49.  
  50.  
  51. " Quickfix next and previous
  52. :nmap <leader>] :lnext<CR>
  53. :nmap <leader>[ :lprevious<CR>
  54.  
  55. " }}}
  56.  
  57. " Language Specific {{{
  58.  
  59. syntax on
  60.  
  61. " Python
  62. let g:pyindent_open_paren = '&sw * 2' " Default values
  63. " set tabstop=2 shiftwidth=2 expandtab
  64. " set list
  65. " set lcs=tab:>-,trail:-
  66.  
  67. " nmap <silent> <leader>+ :call ToggleIndentGuidesTabs()<cr>
  68. " nmap <silent> <leader>= :call ToggleIndentGuidesSpaces()<cr>
  69.  
  70. " function! ToggleIndentGuidesTabs()
  71. " if exists('b:iguides_tabs')
  72. " setlocal nolist
  73. " let &l:listchars = b:iguides_tabs
  74. " unlet b:iguides_tabs
  75. " else
  76. " let b:iguides_tabs = &l:listchars
  77. " setlocal listchars=tab:┆\ "protect the space
  78. " setlocal list
  79. " endif
  80. " endfunction
  81.  
  82. " function! ToggleIndentGuidesSpaces()
  83. " if exists('b:iguides_spaces')
  84. " call matchdelete(b:iguides_spaces)
  85. " unlet b:iguides_spaces
  86. " else
  87. " let pos = range(1, &l:textwidth, &l:shiftwidth)
  88. " call map(pos, '"\\%" . v:val . "v"')
  89. " let pat = '\%(\_^\s*\)\@<=\%(' . join(pos, '\|') . '\)\s'
  90. " let b:iguides_spaces = matchadd('CursorLine', pat)
  91. " endif
  92. " endfunction
  93.  
  94. " vnoremap <NL> :python %<CR>
  95. nnoremap <NL> :!python %<CR>
  96. nnoremap <C-X> :w<CR>:!python %<CR>
  97. inoremap <C-X> <ESC>:w<CR>:!python %<CR>
  98.  
  99.  
  100.  
  101. " }}}
  102.  
  103. " Plugins and settings {{{
  104.  
  105. " nerdcommenter
  106. let NERDSpaceDelims=1
  107.  
  108. " Syntastic
  109. set statusline+=%#warningmsg#
  110. set statusline+=%{SyntasticStatuslineFlag()}
  111. set statusline+=%*
  112.  
  113. let g:syntastic_always_populate_loc_list = 1
  114. let g:syntastic_auto_loc_list = 1
  115. let g:syntastic_check_on_open = 1
  116. let g:syntastic_check_on_wq = 0
  117.  
  118. " MarkdownPreview settings
  119. " use a custom port to start server or random for empty
  120. let g:mkdp_open_to_the_world = 1
  121. let g:mkdp_open_ip = '127.0.0.1' " change to you vps or vm ip
  122. let g:mkdp_port = 8889
  123. function! g:EchoUrl(url)
  124. ! echo url
  125. endfunction
  126. let g:mkdp_browserfunc = '' " 'g:EchoUrl'
  127. let g_mkdp_echo_preview_url = 1
  128. nmap <Leader>md <Plug>MarkdownPreview
  129. nmap <Leader>ms <Plug>MarkdownPreviewStop
  130. nmap <leader><Leader>m <Plug>MarkdownPreviewToggle
  131.  
  132. " }}}
  133.  
  134. " VIMRC {{{
  135.  
  136. nnoremap <leader>ev :vsp $MYVIMRC<CR>
  137. nnoremap <leader>sv :source $MYVIMRC<CR>
  138.  
  139. " }}}
  140.  
  141. " vim:foldmethod=marker:foldlevel=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement