-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
88 lines (65 loc) · 2.39 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
filetype plugin indent on
syntax on
colorscheme Monokai
set exrc secure " source local .vimrc file if present
set number " line numbers
set mouse=a " enable mouse
if &term =~ '^screen'
" tmux knows the extended mouse mode
set ttymouse=xterm2
endif
set backspace=indent,eol,start
set tabstop=4 " how many columns a tab counts for
set softtabstop=4 " how many spaces should be treated as a tab
set shiftwidth=4 " how far an indent is with reindent operations
set expandtab " tab becomes spaces
set autoindent " applies indent of current line to the next one
set smartindent " reacts to syntax/style of code
set colorcolumn=80,100 " ruler at col 80 and 100
set cursorline " highlight current line
set laststatus=2 " make statusline appear even with single window
set statusline=%f " filename
set statusline+=\ %r%m " readonly, modified flags
set statusline+=%= " right align the next part
set statusline+=%y " filetype
set statusline+=\ (%l,%c) " line number, col number
set hlsearch " highlight found words on search
set incsearch " jump to best fit
set showmatch " highlight matching parentheses
set showcmd " show commands as they are typed
let mapleader = "," " set leader key to comma
" Turn off search highlighting with <CR> (return).
nnoremap <CR> :nohlsearch<CR><CR>
" Set .h files to C by default instead of C++
augroup global
autocmd!
autocmd BufRead,BufNewFile *.h set filetype=c
augroup END
" Autoinstall vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | source $MYVIMRC
\| endif
" Specify plugin directory
call plug#begin('~/.vim/plugged')
" FZF
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
" NerdTree
Plug 'preservim/nerdtree'
" TagBar
Plug 'preservim/tagbar'
" Initialize the plugin system
call plug#end()
" FZF file searching with ,L
nnoremap <Leader>l :FZF<CR>
" Toggle NerdTree with ,T
nnoremap <Leader>t :NERDTreeToggle<CR>
" Toggle Tagbar with ,B
nnoremap <Leader>b :TagbarToggle<CR>
" Set syntax highlighting for personal extensions
" autocmd BufNewFile,BufRead *.howto set filetype=text