-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
75 lines (59 loc) · 2.56 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
" BASICS
set nocompatible " Don't try to be vi compatible
syntax on " Turn on syntax highlighting
colorscheme slate " Color scheme
" DISABLE BELL
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set vb t_vb=
" UI CONFIG
set number rnu " show line numbers
set showcmd " show command in bottom bar
filetype plugin on " load filetype-specific plugin files
filetype indent on " load filetype-specific indent files
set omnifunc=syntaxcomplete#Complete " omnifunc autocomplete
set wildmenu " visual autocomplete for command menu
set ruler " always show current position
set splitbelow " fix horizontal split
set splitright " fix vertical split
" TABS & SPACES
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set expandtab " tabs are spaces
set shiftwidth=4 " Single tab autoindent
" SEARCHING
set incsearch " search as characters are entered
set hlsearch " highlight matches
set ignorecase " Ignore case when searching
" FOLDING
set foldenable " enable folding
set foldlevelstart=10 " open most folds by default
set foldnestmax=10 " 10 nested fold max
set foldmethod=indent " fold based on indent level
nnoremap <space> z " remap <space> folding to z
" MAPPING
:let mapleader = "," " Pick a leader key
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" highlight last inserted text
nnoremap gV `[v`]
" Fast (forced) saving
nnoremap <leader>w :w!<cr>
" Remap <C-X><C-O> autocomplete to <C-@> which really means <C-SPACE>
inoremap <C-@> <C-X><C-O>
" :W sudo saves the file
" (useful for handling the permission-denied error)
command! W execute 'w !sudo tee % > /dev/null' <bar> edit!
" Autoindent entire file and return to last pos
nmap <leader>g gg=G''
" Replace all occurrences of word under cursor
nnoremap <leader>ra :%s/\<<C-r><C-W>\>//g<Left><Left>
" SNIPPETS
nnoremap <leader>html :-1 read $HOME/.vim/.skeleton.html<CR>8j10la
nnoremap <leader>cpp :-1 read $HOME/.vim/.skeleton.cpp<CR>3j3la
nnoremap <leader>py :-1 read $HOME/.vim/.skeleton.py<CR>j3la
nnoremap <leader>dc :-1 read $HOME/.vim/.skeleton.dc<CR>3j5l
" LOAD PLUGINS
packloadall
" LOAD HELPTAGS
silent! helptags ALL