-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
102 lines (76 loc) · 2.24 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
" disable vi
set nocompatible
syntax enable
"tab as space
set expandtab
"mark p to toggle paste mode
map p :set invpaste<CR>
"current line highlight
set cursorline
highlight CursorLine cterm=NONE ctermbg=lightgrey
"cursor highlight stays after moving
"nnoremap <silent> <Leader>l ml:execute 'match Search /\%'.line('.').'l/'<CR>
"map g to toggle highlight
"set cursorline!
"set cursorcolumn!
"subble CursorLine
highlight CursorColumn guibg=#404040
"show current file path as status bar at the bottom
set laststatus=2
set statusline=%F
" Start NERDTree
"autocmd VimEnter * NERDTree
" Go to previous (last accessed) window.
autocmd VimEnter * wincmd p
autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
" NERDtree Toggle Shortcut
noremap <leader>q :NERDTreeToggle<CR>
"Easier split navigations
"We can use different key mappings for easy navigation between splits to save a keystroke. So instead of ctrl-w then j, it’s just ctrl-j:
nnoremap <S-J> <C-W><C-J>
nnoremap <S-K> <C-W><C-K>
nnoremap <S-L> <C-W><C-L>
nnoremap <S-H> <C-W><C-H>
" Close all open buffers on entering a window if the only
" buffer that's left is the NERDTree buffer
function! s:CloseIfOnlyNerdTreeLeft()
if exists("t:NERDTreeBufName")
if bufwinnr(t:NERDTreeBufName) != -1
if winnr("$") == 1
q
endif
endif
endif
endfunction
filetype plugin indent on
set autoindent
set tabstop=2
" Enable mouse support in console
set mouse=a
" Line Numbers PWN!
set number
" And so is Artificial Intellegence!
set smartcase
set ignorecase " ignore case when searching
set title " show title in console title bar
set hlsearch " highlight searches
" Space will toggle folds!
nnoremap <space> za
set showcmd " Show (partial) command in status line.
" spelling
if v:version >= 700
" Enable spell check for text files
autocmd BufNewFile,BufRead *.txt setlocal spell spelllang=en
endif
" FINDING FILES:
" Search down into subfolders
" Provides tab-completion for all file-related tasks
set path+=**
" Display all matching files when we tab complete
set wildmenu
" NOW WE CAN:
" - Hit tab to :find by partial match
" - Use * to make it fuzzy
" THINGS TO CONSIDER:
" - :b lets you autocomplete any open buffer
call pathogen#infect('bundle/*')