Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buffers
- " -------------------- HIGHLIGHTING -------------------------
- " Syntax highlighting
- filetype plugin on
- syntax on
- " Highlight cursor line
- set cursorline
- hi CursorLine term=bold cterm=bold
- " ----------------------------------------------------------
- " --------------------- PLUGINS ----------------------------
- " Plugin Manager
- call plug#begin('~/.vim/plugged')
- Plug 'vim-airline/vim-airline'
- Plug 'tpope/vim-fugitive'
- call plug#end()
- " Enable the list of buffers
- let g:airline#extensions#tabline#enabled = 1
- " Show just the filename
- let g:airline#extensions#tabline#fnamemod = ':t'
- let g:airline_powerline_fonts = 1
- " ----------------------------------------------------------
- " --------------------- BUFFERS ----------------------------
- :let mapleader = ","
- " This allows buffers to be hidden if you've modified a buffer.
- " This is almost a must if you wish to use buffers in this way.
- set hidden
- " To open a new empty buffer
- " This replaces :tabnew which I used to bind to this mapping
- nmap <leader>T :enew<cr>
- " Move to the next buffer
- nmap <leader>l :bnext<CR>
- " Move to the previous buffer
- nmap <leader>h :bprevious<CR>
- " Close the current buffer and move to the previous one
- " This replicates the idea of closing a tab
- nmap <leader>bq :bp <BAR> bd #<CR>
- " Show all open buffers and their status
- nmap <leader>bl :ls<CR>
- " ----------------------------------------------------------
- " ------------------- MOVING LINES --------------------------
- " Enable mapping of ALT key for move characters:
- execute "set <M-j>=\ej"
- execute "set <M-k>=\ek"
- " In normal mode or in insert mode, press Alt-j to move the
- " current line down, or press Alt-k to move the current line up.
- nmap <M-j> :m .+1<CR>==
- nmap <M-k> :m .-2<CR>==
- imap <M-j> <Esc>:m .+1<CR>==gi
- imap <M-k> <Esc>:m .-2<CR>==gi
- vmap <M-j> :m '>+1<CR>gv=gv
- vmap <M-k> :m '<-2<CR>gv=gv
- " ----------------------------------------------------------
- " Paste in new line
- :nmap p :pu<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement