diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-06 16:50:46 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-06 16:50:46 +0100 |
| commit | fdb9d0baf798c147360a2ca44ea6761abf7f96c3 (patch) | |
| tree | 17e71ed3284ab6e28079e226030faee71c355d81 /.vimrc | |
| parent | c5eacb8ca315bbf5f9e03e19505ff9f14eacca49 (diff) | |
| download | dotfiles-fdb9d0baf798c147360a2ca44ea6761abf7f96c3.tar.gz dotfiles-fdb9d0baf798c147360a2ca44ea6761abf7f96c3.tar.bz2 dotfiles-fdb9d0baf798c147360a2ca44ea6761abf7f96c3.zip | |
Vim madness started, fix install.sh typo
Diffstat (limited to '.vimrc')
| -rw-r--r-- | .vimrc | 82 |
1 files changed, 55 insertions, 27 deletions
@@ -2,24 +2,25 @@ " vimrc " """""""""" -" source pluggins +" load pluggins source $HOME/dotfiles/.pluggins.vim - " common let mapleader = ' ' " set leader key to space -syntax enable " enable syntax -set hidden " keep change in buffer when quitting window -set noswapfile " disable swap files +let maplocalleader = '-' " set file local leader key to backslash set nocompatible " not compatible with vi -filetype plugin indent on " allow to add specific rules for certain type of file -set number relativenumber " line number relative to cursor +set number " line number +set relativenumber " line number relative to cursor +set numberwidth=1 " line numbers gutter autowidth set cursorline " highlight current line set noshowmatch " dont jump to pair bracket set autoread " reload files when changes happen outside vim +set hidden " keep change in buffer when quitting window +set noswapfile " disable swap files set scrolloff=2 " line padding when scrolling -set encoding=utf-8 " utf-8 encoding set textwidth=89 " when line wrap occurs +set encoding=utf-8 " utf-8 encoding +filetype plugin indent on " allow to add specific rules for certain type of file " browse list with tab set wildmode=longest,list,full @@ -31,18 +32,6 @@ set splitbelow set splitright set fcs+=vert:\ " no split separator -" split navigation -nnoremap <C-J> <C-W><C-J> -nnoremap <C-K> <C-W><C-K> -nnoremap <C-L> <C-W><C-L> -nnoremap <C-H> <C-W><C-H> - -" spit resizing -nnoremap zh <C-W>> -nnoremap zl <C-W>< -nnoremap zj <C-W>- -nnoremap zk <C-W>+ - " tab set expandtab " tab to space set tabstop=4 " tab size @@ -62,6 +51,8 @@ set laststatus=2 " always a statusline (all window) set showcmd " show current partial command in the bottom right set noshowmode " dont show current mode (i.e --INSERT--) +" fold +set foldmethod=indent " create fold based on the text indent " ctrlp pluggin " directory to ignore when searching in file tree @@ -75,24 +66,61 @@ colorscheme onedark let g:lightline = {} let g:lightline.colorscheme = 'one' " lightline theme to onedark -" mappings +"""""""""""" +" mappings " +"""""""""""" + +" split navigation +nnoremap <C-J> <C-W><C-J> +nnoremap <C-K> <C-W><C-K> +nnoremap <C-L> <C-W><C-L> +nnoremap <C-H> <C-W><C-H> + " 'Y' yank to the end of the line noremap Y y$ - " solves annoying delay went exiting insert mode -imap <ESC> <C-C> -" jj or kk to exit insert mode -imap jj <ESC> -imap kk <ESC> +inoremap <ESC> <C-C> +" kj to exit insert mode +inoremap kj <ESC> " remove visual mode keybinding -map Q <ESC> +noremap Q <nop> +" remove command line window keybinding +noremap q: <nop> " incsearch map / <Plug>(incsearch-forward) map ? <Plug>(incsearch-backward) map g/ <Plug>(incsearch-stay) +" move line up and down +nnoremap _ ddkP +nnoremap + ddp +" long move up/down +nnoremap ( 10k +nnoremap ) 10j +" tag nagigation +nnoremap <leader>] <C-]> +nnoremap <leader>t <C-t> +" buffer navigation +nnoremap <leader>n :bn<CR> +nnoremap <leader>p :bp<CR> +nnoremap <leader><TAB> :b#<CR> +nnoremap <leader>l :ls<CR> +" file manipulation with leader +nnoremap <leader>w :w<CR> +nnoremap <leader>x :x<CR> + +" open vimrc in split +nnoremap <leader>rc :vsplit $MYVIMRC<cr> +" source vimrc +nnoremap <leader>src :source $MYVIMRC<cr> + +" file toggle +nnoremap <leader>z zi " remove trailing white space on save autocmd BufWritePre * %s/\s\+$//e +" initialise buf for fold toggle +autocmd BufReadPre * :normal zMzi + " real tab in c file for school projects autocmd Filetype c setlocal noexpandtab |
