Repository navigation
Expand file tree
/
Copy pathvimrc
More file actions
120 lines (94 loc) · 3.24 KB
/
Copy pathvimrc
File metadata and controls
120 lines (94 loc) · 3.24 KB
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
" set guifont=Monaco:h16
set guifont=Menlo:h16
" http://www.google.com/webfonts/family?family=Lekton&subset=latin
" set guifont=Lekton:h18
set number
set go-=T
set hidden
" Needed on some linux distros.
" see http://www.adamlowe.me/2009/12/vim-destroys-all-other-rails-editors.html
filetype off
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
let g:syntastic_enable_signs=1
let g:syntastic_auto_loc_list=1
" Map , to leader
let mapleader = ","
" Show invisible characters
set list
" Shortcut to toggle `set list`
nmap <leader>l :set list!<CR>
" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\ ,eol:¬
:syntax on
filetype plugin indent on
augroup myfiletypes
" Clear old autocmds in group
autocmd!
autocmd BufNewFile,BufRead *.clj* setf clojure
autocmd BufNewFile,BufRead *.json_builder setf ruby
autocmd BufNewFile,BufRead *.red setf ruby
autocmd BufNewFile,BufRead *.erl set ai sw=4 sts=4 et
autocmd BufNewFile,BufRead *.js set ft=javascript.jquery
autocmd BufNewFile,Bufread *.json set ft=json
augroup END
set ts=2
set sts=2
set sw=2
set autoindent
set smarttab
set expandtab
:colorscheme dracula_at_night
set background=dark
":colorscheme vividchalk
":colorscheme solarized
" :colorscheme mac_classic
" window splitting mappings
nmap <leader>v :vsplit<CR> <C-w><C-w>
nmap <leader>s :split<CR> <C-w><C-w>
" Shortcut to toggle nerd tree
map <leader>d :execute 'NERDTreeToggle ' . getcwd()<CR>
nmap <Bar> :execute 'NERDTreeToggle ' . getcwd()<CR>
" Shortcut to delete trailing whitespace
nmap <leader>w :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
" Highlight lines longer than 80 characters
"match ErrorMsg '\%>80v.\+'
" use kj as the escape sequence
inoremap kj <Esc>
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
" TIP: if you write your \labels as \label{fig:something}, then if you
" type in \ref{fig: and press <C-n> you will automatically cycle through
" all the figure labels. Very useful!
set iskeyword+=:
" Fix jslint.vim error according to
" https://github.com/hallettj/jslint.vim/issues/13
let $JS_CMD='node'
" Vim 7.3, now with persistent undo
" From http://news.ycombinator.com/item?id=2907730
set undofile
set undodir=$HOME/.vim_undo,/tmp
" Set the default swap and backup directories
set directory=$HOME/.vim_swp,/tmp
set backupdir=$HOME/.vim_backup,/tmp
" Highlight whitespace at the end of a line
highlight ExtraWhitespace ctermbg=Red guibg=Red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" make sure I'm scrolling visual lines, not real lines
noremap j gj
noremap k gk
" FZF fuzzy finder
set rtp+=/opt/homebrew/opt/fzf
nnoremap <c-p> :Files<cr>
nmap <leader>f :Files<cr>
nmap <leader>b :Buffers<cr>