Mercurial > public > dotfiles
comparison vim/.vimrc @ 16:b8049010198a
Changes to .vimrc after reading Practical Vim.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 29 Dec 2013 18:22:38 -0600 |
parents | d428a965f322 |
children | 33114558b770 |
comparison
equal
deleted
inserted
replaced
15:9b01ad28a5c3 | 16:b8049010198a |
---|---|
47 let c_space_errors = 1 | 47 let c_space_errors = 1 |
48 let python_space_error_highlight = 1 | 48 let python_space_error_highlight = 1 |
49 | 49 |
50 set background=dark | 50 set background=dark |
51 colorscheme peaksea2 | 51 colorscheme peaksea2 |
52 " colorscheme Dark | |
53 | 52 |
54 " shortcut for word completion in insert mode | 53 " shortcut for word completion in insert mode |
55 imap <S-Tab> <C-n> | 54 imap <S-Tab> <C-n> |
56 | 55 |
57 " buffer next and previous commands | 56 " buffer next and previous commands |
58 nnoremap <Tab> :bnext<CR> | 57 " TODO: find a better mapping |
59 nnoremap <S-Tab> :bprevious<CR> | 58 " TODO: nnoremap <Tab> :bnext<CR> |
59 " TODO: nnoremap <S-Tab> :bprevious<CR> | |
60 | 60 |
61 " Remove extra trailing spaces | 61 " Remove extra trailing spaces |
62 nnoremap <F2> :%s/\s\+$//<CR> | 62 nnoremap <F2> :%s/\s\+$//<CR> |
63 | 63 |
64 " setlocal spell spelllang=en_us | 64 " setlocal spell spelllang=en_us |
65 | 65 |
66 let mapleader="," | 66 let mapleader="\\" |
67 | |
68 " NERD tree plugin | |
69 " nmap ,n :NERDTreeToggle<CR> | |
70 " let g:NERDTreeQuitOnOpen=1 | |
71 | 67 |
72 " ctags support | 68 " ctags support |
73 | 69 |
74 function BgnCtags() | 70 function BgnCtags() |
75 let d = fnamemodify(findfile("root.dir", ";"), ":p:h") | 71 let d = fnamemodify(findfile("root.dir", ";"), ":p:h") |
90 set wildmode=list:longest | 86 set wildmode=list:longest |
91 set laststatus=2 | 87 set laststatus=2 |
92 set gdefault | 88 set gdefault |
93 set showmatch | 89 set showmatch |
94 set formatoptions=tcqrn1 | 90 set formatoptions=tcqrn1 |
95 nnoremap ,/ :noh<CR> | 91 nnoremap <leader>/ :noh<CR> |
96 " nnoremap / /\v | 92 nnoremap / /\v |
97 " vnoremap / /\v | 93 vnoremap / /\v |
98 | 94 |
99 " Splitting windows and moving around between them: | 95 " Splitting windows and moving around between them: |
100 nnoremap ,v <C-w>v<C-w>l | 96 nnoremap <leader>v <C-w>v<C-w>l |
101 nnoremap <C-h> <C-w>h | 97 nnoremap <C-h> <C-w>h |
102 nnoremap <C-j> <C-w>j | 98 nnoremap <C-j> <C-w>j |
103 nnoremap <C-k> <C-w>k | 99 nnoremap <C-k> <C-w>k |
104 nnoremap <C-l> <C-w>l | 100 nnoremap <C-l> <C-w>l |
105 | 101 |
106 " Absolute vs relative line numbers: | 102 " Absolute vs relative line numbers: |
107 nnoremap ,na :set norelativenumber<CR>:set number<CR> | 103 nnoremap <leader>na :set norelativenumber<CR>:set number<CR> |
108 nnoremap ,nr :set relativenumber<CR> | 104 nnoremap <leader>nr :set relativenumber<CR> |
109 | 105 |
110 " Format paragraph | 106 " Format paragraph |
111 nnoremap ,p gqip | 107 nnoremap <leader>p gqip |
112 | 108 |
113 function BgnSwitchPart() | 109 function BgnSwitchPart() |
114 python << EOF | 110 python << EOF |
115 import vim, os.path, sys | 111 import vim, os.path, sys |
116 fname = vim.current.buffer.name | 112 fname = vim.current.buffer.name |
134 else: | 130 else: |
135 sys.stderr.write("Uknown extension %s" % ext) | 131 sys.stderr.write("Uknown extension %s" % ext) |
136 EOF | 132 EOF |
137 endfunction | 133 endfunction |
138 | 134 |
139 nnoremap ,s :call BgnSwitchPart()<CR> | 135 nnoremap <leader>s :call BgnSwitchPart()<CR> |
140 | 136 |
141 " Pathogen support | 137 " Pathogen support |
142 call pathogen#infect() | 138 call pathogen#infect() |