-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
79 lines (64 loc) · 2.12 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
set nocompatible
set background=dark
color desert
syntax on
filetype plugin indent on
set encoding=utf-8
set hidden "allow hiding buffers with unsaved changes
set showmode "show edit mode at bottom of screen
set showcmd "shows command in bottom right
set rnu "show line numbers
set ruler "always show cursor position
set nowrap
set tabstop=4 shiftwidth=4 softtabstop=4
set expandtab "tabs to spaces
set smarttab
set backspace=indent,eol,start "backspace through everything in insert mode
set noerrorbells "No error bells
set visualbell t_vb= "No visual bell
set scrolloff=5 "Make sure you always get 5 lines visually around the cursor when scrolling
set autoread "Automatically realod files when they're changed by an external program
set hlsearch
set incsearch
set ignorecase
set smartcase
""make line numbers grey
highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
""Autocomplete
set wildmode=longest,list "first tab does partial completion, 2nd shows list
set wildmenu "enables tab completion
""Backup
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
""GUI Only
set antialias
if has("gui_running")
set guioptions-=T
endif
"Make funny character show up red
highlight NonText ctermfg=DarkRed
" Turn off arrow keys
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
" \ is the leader character
let mapleader = ","
" Hide search highlighting
map <Leader>h :set invhls <CR>
" prepopulate command line with :e <current file directory>
map <leader>ew :e <C-R>=expand("%:p:h")."/"<CR>
" toggle autoclose on and off
map <leader>a :AutoCloseToggle
" toggle between relative and actual line numbers
function! g:ToggleNuMode()
if(&rnu == 1)
set nu
else
set rnu
endif
endfunc
nnoremap <C-L> :call g:ToggleNuMode()<cr>