Advertisement
hl183

vimrc

Jul 7th, 2019
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.64 KB | None | 0 0
  1. """Vim-Plug"""""""""""""""""""""""""""""""""""""""
  2. call plug#begin()
  3.  
  4. Plug 'scrooloose/nerdtree'
  5. Plug 'tpope/vim-commentary'
  6. Plug 'morhetz/gruvbox'
  7. Plug 'ervandew/supertab'
  8. Plug 'itchyny/lightline.vim'
  9. Plug '~/.fzf'
  10. Plug 'junegunn/fzf.vim'
  11. " Plug 'w0rp/ale'
  12.  
  13. call plug#end()
  14.  
  15. """Setting"""""""""""""""""""""""""""""""""""""""
  16. " set timeoutlen=1000 ttimeoutlen=0 "VIM ONLY --No delay switching modes--
  17. "--Sessions--
  18. " autocmd! VimLeave * mksession
  19. " autocmd! VimEnter * source ~/Session.vim
  20. "--Folding--
  21. " autocmd BufWinLeave *.* mkview
  22. " autocmd BufWinEnter *.* silent loadview"
  23. " set foldmethod=syntax "syntax highlighting items specify folds *SLOW
  24. " set foldcolumn=1 "defines 1 col at window left, to indicate folding
  25. " let javaScript_fold=1 "activate folding by JS syntax
  26. " set foldlevelstart=99 "start file with all folds opened
  27.  
  28. "--Others--
  29. " set signcolumn=yes
  30. " set nu rnu
  31. " set nu
  32.  
  33. set noshowmode
  34. set laststatus=2
  35. set noswapfile
  36. filetype plugin indent on
  37. set number relativenumber
  38. autocmd InsertEnter,InsertLeave * set cul! "Insert Cursor Highlingting"
  39. set termguicolors
  40. set background=light
  41. set showcmd            " Show (partial) command in status line.
  42. set showmatch          " Show matching brackets.
  43. set ignorecase         " Do case insensitive matching
  44. set smartcase          " Do smart case matching
  45. set incsearch          " Incremental search (highlight during search)
  46. set autowrite          " Automatically save before commands like :next and :make
  47. set hidden             " Hide buffers when they are abandoned
  48. set mouse=a            " Enable mouse usage (all modes)
  49. set nohlsearch
  50. set splitright
  51. set splitbelow
  52.  
  53. "--Cursors--
  54. let &t_SI = "\<Esc>[5 q"
  55. let &t_SR = "\<Esc>[4 q"
  56. let &t_EI = "\<Esc>[2 q"
  57.  
  58. "--Indentation--
  59. set shiftwidth=4
  60. set tabstop=4
  61. set list  "Indent Guide"
  62. set listchars=tab:›\ ,trail:•,extends:#,nbsp:.
  63.  
  64. """MAPPINGS""""""""""""""""""""""""""""""""""""""""
  65. "To use `ALT+{h,j,k,l}` to navigate windows from any mode:
  66. " tnoremap <A-h> <C-\><C-N><C-w>h
  67. " tnoremap <A-j> <C-\><C-N><C-w>j
  68. " tnoremap <A-k> <C-\><C-N><C-w>k
  69. " tnoremap <A-l> <C-\><C-N><C-w>l
  70. " inoremap <A-h> <C-\><C-N><C-w>h
  71. " inoremap <A-j> <C-\><C-N><C-w>j
  72. " inoremap <A-k> <C-\><C-N><C-w>k
  73. " inoremap <A-l> <C-\><C-N><C-w>l
  74. " nnoremap <A-h> <C-w>h
  75. " nnoremap <A-j> <C-w>j
  76. " nnoremap <A-k> <C-w>k
  77. " nnoremap <A-l> <C-w>l
  78.  
  79. "map space to leader
  80. nnoremap <Space> <Nop>
  81. let mapleader = "\<Space>"
  82. noremap <leader>h :set hlsearch! hlsearch?<CR>
  83. inoremap jk <esc>
  84.  
  85. "session
  86. map <F3> :mks!<CR>
  87. map <F5> :source ~/Session.vim<CR>
  88.  
  89. "scrolling
  90. nnoremap <C-j> }
  91. nnoremap <C-k> {
  92.  
  93. "line navigation
  94. nnoremap B ^
  95. nnoremap E $
  96.  
  97. "---windows management----------
  98. map <C-w> :q!<CR>
  99. map <C-s> :w<CR>
  100. map <C-\> :vnew<CR>
  101. map <C-A-\> :new<CR>
  102.  
  103. "switch between windows
  104. nnoremap <A-w> <C-w>w
  105. inoremap <A-w> <C-\><C-N><C-w>w
  106. tnoremap <A-w> <C-\><C-N><C-w>w
  107.  
  108. "move windows
  109. nnoremap <C-A-h> <C-w>H
  110. nnoremap <C-A-j> <C-w>J
  111. nnoremap <C-A-k> <C-w>K
  112. nnoremap <C-A-l> <C-w>L
  113. tnoremap <C-A-h> <C-\><C-N><C-w>H
  114. tnoremap <C-A-j> <C-\><C-N><C-w>J
  115. tnoremap <C-A-k> <C-\><C-N><C-w>K
  116. tnoremap <C-A-l> <C-\><C-N><C-w>L
  117. inoremap <C-A-h> <C-\><C-N><C-w>H
  118. inoremap <C-A-j> <C-\><C-N><C-w>J
  119. inoremap <C-A-k> <C-\><C-N><C-w>K
  120. inoremap <C-A-l> <C-\><C-N><C-w>L
  121.  
  122. "moving cursor insert mode
  123. inoremap <A-h> <C-\><C-N>ha
  124. inoremap <A-j> <C-\><C-N>ja
  125. inoremap <A-k> <C-\><C-N>ka
  126. inoremap <A-l> <C-\><C-N>la
  127.  
  128. "resize windows
  129. nnoremap <A-h> :vertical resize -5<CR>
  130. nnoremap <A-j> :res -2<CR>
  131. nnoremap <A-k> :res +2<CR>
  132. nnoremap <A-l> :vertical resize +5<CR>
  133. tnoremap <A-h> :vertical resize -5<CR>
  134. tnoremap <A-j> :res -2<CR>
  135. tnoremap <A-k> :res +2<CR>
  136. tnoremap <A-l> :vertical resize +5<CR>
  137.  
  138. "---plugins mapping----------
  139. "nerdTree
  140. map <C-n> :NERDTreeToggle<CR>
  141.  
  142. "fzf
  143. map <C-f> :Files<CR>
  144. map <C-b> :Buffers<CR>
  145. map <C-h> :History<CR>
  146. map <C-l> :Lines<CR>
  147. map <C-m> :Marks<CR>
  148.  
  149. "--SuperTab--
  150. let g:SuperTabDefaultCompletionType = "<c-n>"
  151.  
  152. "--ALE--
  153. " nmap <silent> <C-k> <Plug>(ale_previous_wrap)
  154. " nmap <silent> <C-j> <Plug>(ale_next_wrap)
  155.  
  156. """"PLUGINS SETTING""""""""""""""""""""""""""""""""""""""""
  157. "gruvbox
  158. let g:gruvbox_invert_selection=0
  159. let g:gruvbox_italic = '1'
  160. let g:gruvbox_contrast_dark = 'medium'
  161. let g:gruvbox_contrast_light = 'soft'
  162. colorscheme gruvbox
  163.  
  164. "lightline
  165. let g:lightline = {
  166.       \ 'colorscheme': 'gruvbox',
  167.       \ }
  168.  
  169. """"""""""""""""""""""""""""""""""""""""""""""""""""
  170. """"""""""NVIM""""""""""""""""""""""""""""""""""""""
  171. set clipboard=unnamedplus
  172. "--Mapping--
  173. tnoremap jk <C-\><C-n>
  174. "--Terminal
  175. " map <leader>t :vsplit term://fish<CR>
  176. " map <leader>y :split term://fish<CR>
  177. map <C-t> :terminal<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement