Added vimrc/gvimrc from kanaya
This commit is contained in:
parent
ed68edf732
commit
132ec13712
|
|
@ -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
|
||||
|
||||
|
|
@ -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 <CR> <CR>x<BS>
|
||||
"nnoremap o ox<BS>
|
||||
"nnoremap O Ox<BS>
|
||||
|
||||
" 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 <MiddleMouse> <Nop>
|
||||
map <2-MiddleMouse> <Nop>
|
||||
map <3-MiddleMouse> <Nop>
|
||||
map <4-MiddleMouse> <Nop>
|
||||
imap <MiddleMouse> <Nop>
|
||||
imap <2-MiddleMouse> <Nop>
|
||||
imap <3-MiddleMouse> <Nop>
|
||||
imap <4-MiddleMouse> <Nop>
|
||||
|
||||
|
||||
" Keyboard mappings
|
||||
" -----------------
|
||||
nnoremap <C-L> :nohl<CR>:diffupdate<CR><C-L>
|
||||
set pastetoggle=<F2>
|
||||
|
||||
" 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 <C-S> to save
|
||||
nnoremap <silent> <C-s> :<C-u>Update<CR>
|
||||
inoremap <C-s> <C-o>:Update<CR>
|
||||
|
||||
" Edit (\ev) and reload (\rv) .vimrc (reload .gvimrc if running gvim)
|
||||
nnoremap <leader>ev :split $MYVIMRC<CR>
|
||||
if has('gui_running')
|
||||
nnoremap <leader>rv :source $MYVIMRC<CR>:source $MYGVIMRC<CR>
|
||||
else
|
||||
nnoremap <leader>rv :source $MYVIMRC<CR>
|
||||
endif
|
||||
|
||||
" Split line at cursor with <C-J> (as opposite of <Shift-J> for join lines)
|
||||
nnoremap <C-J> i<CR><Esc>k$
|
||||
|
||||
|
||||
" 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 <Leader>l :ls<CR>
|
||||
nnoremap <Leader>b :bp<CR>
|
||||
nnoremap <Leader>n :bn<CR>
|
||||
nnoremap <Leader>g :e#<CR>
|
||||
nnoremap <Leader>1 :1b<CR>
|
||||
nnoremap <Leader>2 :2b<CR>
|
||||
nnoremap <Leader>3 :3b<CR>
|
||||
nnoremap <Leader>4 :4b<CR>
|
||||
nnoremap <Leader>5 :5b<CR>
|
||||
nnoremap <Leader>6 :6b<CR>
|
||||
nnoremap <Leader>7 :7b<CR>
|
||||
nnoremap <Leader>8 :8b<CR>
|
||||
nnoremap <Leader>9 :9b<CR>
|
||||
nnoremap <Leader>0 :10b<CR>
|
||||
|
||||
" Compiling and making
|
||||
nnoremap <F9> :w<CR>:make<CR>:redraw!\|cw<CR>
|
||||
nnoremap <F10> :up<CR>:make run<CR>:redraw! \| cw<CR>
|
||||
|
||||
" Tab buffers
|
||||
nnoremap <F12> :tab ball<CR>
|
||||
|
||||
" Tab movement
|
||||
noremap <A-[> :-tabmove<CR>
|
||||
noremap <A-]> :+tabmove<CR>
|
||||
|
||||
|
||||
" -- Shortcuts for insert mode
|
||||
" Exit insert mode
|
||||
imap ,, <ESC>
|
||||
inoremap <A-,> <ESC>
|
||||
|
||||
" Quick movement with Alt-h/j/k/l
|
||||
inoremap <A-h> <C-o>h
|
||||
inoremap <A-j> <C-o>j
|
||||
inoremap <A-k> <C-o>k
|
||||
inoremap <A-l> <C-o>l
|
||||
|
||||
|
||||
" Copy and to X clipboard (Ctrl-C in visual mode and Ctrl-V in insert mode)
|
||||
vmap <C-C> "+y
|
||||
imap <C-V> <C-\><C-O>"+P
|
||||
|
||||
" Undo in insert mode with Ctrl-U
|
||||
imap <C-U> <C-O>u
|
||||
|
||||
" Quick exit
|
||||
map Q :qa<CR>
|
||||
|
||||
" Quick navigation to next buffer
|
||||
" TODO?
|
||||
"map <F2> :n<CR>
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue