Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1.  buffers
  2.  
  3. " -------------------- HIGHLIGHTING -------------------------
  4. " Syntax highlighting
  5. filetype plugin on
  6. syntax on
  7.  
  8. " Highlight cursor line
  9. set cursorline
  10. hi CursorLine term=bold cterm=bold
  11. " ----------------------------------------------------------
  12.  
  13.  
  14. " --------------------- PLUGINS ----------------------------
  15. " Plugin Manager
  16. call plug#begin('~/.vim/plugged')
  17.  
  18. Plug 'vim-airline/vim-airline'
  19. Plug 'tpope/vim-fugitive'
  20.  
  21. call plug#end()
  22.  
  23. " Enable the list of buffers
  24. let g:airline#extensions#tabline#enabled = 1
  25.  
  26. " Show just the filename
  27. let g:airline#extensions#tabline#fnamemod = ':t'
  28.  
  29. let g:airline_powerline_fonts = 1
  30. " ----------------------------------------------------------
  31.  
  32.  
  33. " --------------------- BUFFERS ----------------------------
  34. :let mapleader = ","
  35.  
  36. " This allows buffers to be hidden if you've modified a buffer.
  37. " This is almost a must if you wish to use buffers in this way.
  38. set hidden
  39.  
  40. " To open a new empty buffer
  41. " This replaces :tabnew which I used to bind to this mapping
  42. nmap <leader>T :enew<cr>
  43.  
  44. " Move to the next buffer
  45. nmap <leader>l :bnext<CR>
  46.  
  47. " Move to the previous buffer
  48. nmap <leader>h :bprevious<CR>
  49.  
  50. " Close the current buffer and move to the previous one
  51. " This replicates the idea of closing a tab
  52. nmap <leader>bq :bp <BAR> bd #<CR>
  53.  
  54. " Show all open buffers and their status
  55. nmap <leader>bl :ls<CR>
  56. " ----------------------------------------------------------
  57.  
  58.  
  59. " ------------------- MOVING LINES --------------------------
  60. " Enable mapping of ALT key for move characters:
  61. execute "set <M-j>=\ej"
  62. execute "set <M-k>=\ek"
  63.  
  64. " In normal mode or in insert mode, press Alt-j to move the
  65. " current line down, or press Alt-k to move the current line up.
  66. nmap <M-j> :m .+1<CR>==
  67. nmap <M-k> :m .-2<CR>==
  68. imap <M-j> <Esc>:m .+1<CR>==gi
  69. imap <M-k> <Esc>:m .-2<CR>==gi
  70. vmap <M-j> :m '>+1<CR>gv=gv
  71. vmap <M-k> :m '<-2<CR>gv=gv
  72.  
  73. " ----------------------------------------------------------
  74.  
  75. " Paste in new line
  76. :nmap p :pu<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement