-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
121 lines (98 loc) · 2.25 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
syntax enable
" colors
set t_Co=256
" gui
if has("gui_running")
set guifont=Inconsolata 13
set lines=36
set columns=148
set guioptions-=T
set guioptions-=r
set guioptions-=R
set guioptions-=l
set guioptions-=L
else
"let terminal resize scale the internal windows
au VimResized * :wincmd =
map <silent> <F4> <ESC>:set paste!<CR>
end
set cf
set clipboard=unnamedplus
set history=256
set autowrite
set ruler
set nu
set wrap
set timeoutlen=250
set hidden
" Formatting
set ts=8
set sts=8
set sw=8
set bs=2
set nocp incsearch "nohlsearch
set smartcase
set cinoptions=:0,p0,t0
set cinwords=if,else,while,do,for,switch,case
set cindent
set autoindent
set smarttab
set noexpandtab
set smartindent
set formatoptions=twn2
" Visual
set showmatch " Show matching brackets.
set mat=5 " Bracket blinking.
set list listchars=tab:\ \ ,trail:•,nbsp:˽
set novisualbell
set noerrorbells
set laststatus=2
set mousehide
set mouse=a
" Sudo to write
cnoremap w!! w !sudo tee % >/dev/null<CR>
" leader stuff
let mapleader=","
map , <leader>
map <leader>e <ESC>:e ~/.vim/vimrc<CR>
map <leader>r <ESC>:source ~/.vim/vimrc<CR>
nnoremap <leader>w :set wrap!<CR>
"other stuff
"set scrolloff=2 "So the cursor doesnt get lost on the edge
set wildmode=longest,list
set showmode "show the change to the user
set showcmd
set shortmess=aoI
"folding settings
set foldmethod=manual "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
"set nofoldenable "dont fold by default
"NERDTRee
map <silent> <C-N> <ESC>:NERDTreeToggle<CR>
"BufExplorer
nmap <silent> <C-H> <ESC>:BufExplorer<CR>
set encoding=utf-8 " Necessary to show unicode glyphs
" vim-airline
let g:airline_powerline_fonts=0
cmap Q q!
nmap q :q
" line numbers
map <silent> <F2> <ESC>:set number!<CR>
" indent all
map <silent> <F3> <ESC>mzgg=G`z
" formatoptions fix
au FileType * setlocal formatoptions-=r
au FileType * setlocal formatoptions-=o
" Allow to gf when '=' is used without spaces
set includeexpr=substitute(v:fname,'^.*=-\\?','','')
" stop vim to reindent comments
set cinkeys-=0#
"" tagbar
"nmap <F8> :TagbarToggle<CR>
"" termdebug
"pa! termdebug
"au BufNewFile,BufRead *.rs let termdebugger="rust-gdb"
set bg=dark