-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·100 lines (80 loc) · 1.93 KB
/
vimrc
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
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
" source $VIMRUNTIME/mswin.vim
behave xterm
" Highlight for trailing white space
:autocmd ColorScheme * highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
" Syntax highlight
syntax on
colorscheme default
set background=dark
" Tab width
set tabstop=4
set shiftwidth=4
set softtabstop=0
set expandtab
" Something
set nocompatible
set showmatch
set ruler
set showcmd
set incsearch
set hlsearch
" Formatting
set autoindent
set smartindent
" Mouse
set mouse=a
" tags
set tags+=/usr/include/tags
set tags+=/src/vas/tags
" Line number
set number
if has("win32") || has("win64")
set directory=\vimswap
set backupdir=\vimswap
set undodir=\vimswap
else
set directory=~/.vimcache
set backupdir=~/.vimcache
set undodir=~/.vimcache
end
" Incremental searches
set incsearch
set hlsearch
" Mark lines longer than 80 characters
" Use colorcolumn if the feature exists, available since VIM 7.3.
if exists("+colorcolumn")
highlight ColorColumn ctermbg=grey ctermfg=black
set colorcolumn=80
else
highlight OverLength ctermbg=red ctermfg=white
match OverLength /\%81v.*/
endif
" Show trailing white space (more than one space, one single space is ok)
:match ExtraWhitespace /\s\s\+$/
" shorthand tabnew
" nmap nt :tabnew<CR>
" cmap nt tabnew
nnoremap <silent> <F8> :TlistToggle<CR>
"let Tlist_Auto_Open = 1
"let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_Use_Right_Window = 1
let Tlist_Exit_OnlyWindow = 1
" Keybindings for NERDTree
nnoremap <silent> <F7> :NERDTreeFind<CR>
nnoremap <silent> <F6> :NERDTreeClose<CR>
" Python wants spaces instead of tabs
autocmd FileType python set expandtab
" To reset focused window to the edited file after open.
"autocmd VimEnter * exe 1 . "wincmd w"
let mapleader = "§"
imap jj <Esc>
nnoremap <Leader>l :set invlist
nnoremap <Leader>h :nohlsearch
nnoremap <Leader>w :set invwrap
set ignorecase
set infercase
set smartcase
set smarttab
set scrolloff=3