diff --git a/.gvimrc b/.gvimrc new file mode 100644 index 0000000..ecb9a6c --- /dev/null +++ b/.gvimrc @@ -0,0 +1,12 @@ +"set bg=light + +" Set colorscheme and custom colors +colorscheme slate +highlight Cursor guifg=black guibg=white + +" Autocompletion menu background +highlight Pmenu guibg=darkviolet + +" HTML: tabs have a white background, change that +highlight htmlHead guibg=NONE + diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..10cb672 --- /dev/null +++ b/.vimrc @@ -0,0 +1,142 @@ +" Load pathogen +" TODO +"execute pathogen#infect() + +" Visual settings +set bg=dark +set number +highlight LineNr ctermfg=darkgrey + +" Syntax highlighting +syntax on +set hlsearch + +" Case insensitive search (except for when explicitly using uppercase letters) +set ignorecase +set smartcase + +" Indentation options +set autoindent +set shiftwidth=4 +set tabstop=4 + +" Indentation for Python (use 4 spaces) +"autocmd FileType python setlocal expandtab shiftwidth=4 softtabstop=4 + +" Indentation (don't remove tabs from empty lines) +"inoremap x +"nnoremap o ox +"nnoremap O Ox + +" Mouse settings +set mouse=a + +" Do not insert comment leader when entering insert mode with 'o'/'O' in comment line +autocmd BufNewFile,BufRead * set formatoptions-=o + +" clang autocomplete: do not open completion box automatically +let g:clang_complete_auto=0 + + +" Disable middle mouse button paste (in vim and gvim) +map +map <2-MiddleMouse> +map <3-MiddleMouse> +map <4-MiddleMouse> +imap +imap <2-MiddleMouse> +imap <3-MiddleMouse> +imap <4-MiddleMouse> + + +" Keyboard mappings +" ----------------- +nnoremap :nohl:diffupdate +set pastetoggle= + +" If the current buffer has never been saved, it will have no name, +" call the file browser to save it, otherwise just save it. +command! -nargs=0 -bar Update if &modified + \| if empty(bufname('%')) + \| browse confirm write + \| else + \| confirm write + \| endif + \|endif + +" Bind to save +nnoremap :Update +inoremap :Update + +" Edit (\ev) and reload (\rv) .vimrc (reload .gvimrc if running gvim) +nnoremap ev :split $MYVIMRC +if has('gui_running') + nnoremap rv :source $MYVIMRC:source $MYGVIMRC +else + nnoremap rv :source $MYVIMRC +endif + +" Split line at cursor with (as opposite of for join lines) +nnoremap ik$ + + +" Easier buffer switching +" ----------------------- +" Mappings to access buffers (don't use "\p" because a +" delay before pressing "p" would accidentally paste). +" \l : list buffers +" \b \n \g : go back/forward/last-used +" \1 \2 \3 : go to buffer 1/2/3 etc +nnoremap l :ls +nnoremap b :bp +nnoremap n :bn +nnoremap g :e# +nnoremap 1 :1b +nnoremap 2 :2b +nnoremap 3 :3b +nnoremap 4 :4b +nnoremap 5 :5b +nnoremap 6 :6b +nnoremap 7 :7b +nnoremap 8 :8b +nnoremap 9 :9b +nnoremap 0 :10b + +" Compiling and making +nnoremap :w:make:redraw!\|cw +nnoremap :up:make run:redraw! \| cw + +" Tab buffers +nnoremap :tab ball + +" Tab movement +noremap :-tabmove +noremap :+tabmove + + +" -- Shortcuts for insert mode +" Exit insert mode +imap ,, +inoremap + +" Quick movement with Alt-h/j/k/l +inoremap h +inoremap j +inoremap k +inoremap l + + +" Copy and to X clipboard (Ctrl-C in visual mode and Ctrl-V in insert mode) +vmap "+y +imap "+P + +" Undo in insert mode with Ctrl-U +imap u + +" Quick exit +map Q :qa + +" Quick navigation to next buffer +" TODO? +"map :n + diff --git a/createlinks.sh b/createlinks.sh index 1e674c2..dcfd23a 100644 --- a/createlinks.sh +++ b/createlinks.sh @@ -41,9 +41,13 @@ makelink_simple() { # ~/bin makelink "$dotfiles/bin/" bin -# dotfiles +# bash, profile, etc. makelink_simple .profile makelink_simple .bashrc makelink_simple .bash_profile makelink_simple .bash_logout +# vim +makelink_simple .vimrc +makelink_simple .gvimrc +