-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
147 lines (115 loc) · 3.17 KB
/
vimrc
File metadata and controls
147 lines (115 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
set nocompatible
filetype off
filetype plugin on
" Indentation
set ts=4
set sts=4
set sw=4
set expandtab
set mouse=a
autocmd FileType html set expandtab
autocmd FileType html set sw=2
autocmd FileType html set ts=2
autocmd FileType html set sts=2
autocmd FileType html set textwidth=0
autocmd FileType html set syntax=htmljinja
autocmd FileType htmldjango set expandtab
autocmd FileType htmldjango set sw=2
autocmd FileType htmldjango set ts=2
autocmd FileType htmldjango set sts=2
autocmd FileType htmldjango set textwidth=0
autocmd FileType htmldjango set syntax=htmljinja
autocmd FileType css set expandtab
autocmd FileType css set sw=4
autocmd FileType css set ts=4
autocmd FileType css set sts=4
autocmd FileType css set textwidth=0
autocmd FileType css set syntax=css
autocmd FileType javascript set expandtab
autocmd FileType javascript set sw=4
autocmd FileType javascript set ts=4
autocmd FileType javascript set sts=4
autocmd FileType javascript set textwidth=0
autocmd FileType javascript set syntax=javascript
autocmd FileType python set expandtab
autocmd FileType python set sw=4
autocmd FileType python set ts=4
autocmd FileType python set sts=4
autocmd FileType python set textwidth=0
autocmd FileType python set syntax=python
set wrap
set linebreak
set backspace=2 " make backspace work like other apps
set ignorecase
syntax on
set autoindent
set background=dark
"Keyboard mappings
let mapleader=","
" Tab navigation
nmap tk :tabnext<CR>
nmap tj :tabprevious<CR>
nmap tl :tablast<CR>
nmap th :tabfirst<CR>
nmap <C-t> :tabnew<CR>
" Window navigation
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
" Window sizing
nmap <leader>= <C-w>+
nmap <leader>- <C-w>-
" Shortcut to rapidly toggle `set list`
nmap <leader>l :set list!<CR>
" Shortcut to toggle spell checking
map <leader>s :set spell!<cr>
" Shortcut to toggle line numbers
map <leader>n :set number!<cr>
" Shortcut to edit vimrc file
map <leader>v :tabedit ~/.vimrc<cr>
" Shortcut to source vimrc
nmap <Leader>s :source $MYVIMRC<cr>
" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:T\ ,eol:$
" Text bubbling
map <C-Up> ddkp<cr>
map <C-Down> ddp<cr>
" Colors
set t_Co=256
" Colorscheme
colorscheme Mustang
" Show syntax highlighting groups for word under cursor
nmap <C-S-P> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
" Functions
function! TclTest()
r~/.vim/templates/tcltest
endfunc
map <silent> <leader>1 <Esc>:call TclTest()<cr>
set history=1000
set wildmode=list:longest
" Highlight long lines
" highlight OverLength ctermbg=red ctermfg=white guibg=#592929
" match OverLength /\%101v.\+/
" Code folding
set number
" For powerline
set laststatus=2
set nowrap
hi CursorLine cterm=NONE ctermbg=darkblue ctermfg=white guibg=darkred guifg=white
hi CursorColumn cterm=NONE ctermbg=darkblue ctermfg=white guibg=darkred guifg=white
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
" Easy split navigatino
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Improve up/down movement on wrapped lines
nnoremap j gj
nnoremap k gk