-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
145 lines (120 loc) · 3.45 KB
/
Copy pathvimrc
File metadata and controls
145 lines (120 loc) · 3.45 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
set directory=~/.vim/backup
set backupdir=~/.vim/backup " keep swap files here
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Keep Plugin commands between vundle#begin/end.
Plugin 'tpope/vim-fugitive'
Plugin 'bling/vim-airline'
Plugin 'mileszs/ack.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'easymotion/vim-easymotion'
Plugin 'benmills/vimux'
Plugin 'dracula/vim'
Plugin 'rodjek/vim-puppet'
Plugin 'kchmck/vim-coffee-script'
Plugin 'airblade/vim-gitgutter'
Plugin 'neovimhaskell/haskell-vim'
Plugin 'derekwyatt/vim-scala'
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'guns/vim-clojure-static'
Plugin 'tpope/vim-repeat.git'
Plugin 'tpope/vim-surround.git'
Plugin 'junegunn/vim-easy-align'
Plugin 'scrooloose/syntastic'
Plugin 'altercation/vim-colors-solarized'
" old Vundle stuff
Bundle 'wikitopian/hardmode'
Bundle 'w0ng/vim-hybrid'
Bundle 'gosukiwi/vim-atom-dark'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Non-Plugin stuff after this line
" ================================
" Enable syntastic only on certain types
let g:syntastic_mode_map = {
\ "mode": "passive",
\ "active_filetypes": ["ruby", "python", "haskell", "scala"],
\ "passive_filetypes": [] }
let g:syntastic_ignore_files = ['\m\c\.h$', '\m\.sbt$']
" Gitgutter show more signs
let g:gitgutter_max_signs = 1500
" Scala has fsc and scalac checkers--running both is pretty redundant and
" " slow. An explicit `:SyntasticCheck scalac` can always run the other.
let g:syntastic_scala_checkers = ['fsc']
" Function for number toggle
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
else
set relativenumber
endif
endfunc
nnoremap <C-N> :call NumberToggle()<cr>
" Function for whitespace toggle
function! WhitespaceToggle()
set listchars=eol:¬,tab:--,trail:~,extends:>,precedes:<
if(&list ==1)
set nolist
else
set list
endif
endfunc
nnoremap <C-T> :call WhitespaceToggle()<cr>
function! TrimWhitespace()
let l:save_cursor = getpos('.')
%s/\s\+$//e
call setpos('.', l:save_cursor)
endfun
command! TrimWhitespace call TrimWhitespace() " Trim whitespace with command
autocmd BufWritePre * :call TrimWhitespace() " Trim whitespace on every save
" Non-mapped function for tab toggles
function! TabToggle()
if &expandtab
set noexpandtab
else
set expandtab
endif
endfunc
" Remappings
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
" Disable arrows
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" Nerdtree
map <C-F> :NERDTreeToggle<CR>
" Other (default) options
set t_Co=256
set relativenumber
set number
let mapleader=','
set backspace=2
colorscheme dracula
syntax on
set laststatus=2
set noshowmode
let s:uname = system("uname -a")
if s:uname =~ "NixOS"
set shell=/run/current-system/sw/bin/bash
else
set shell=/bin/bash
endif
" Draw a line at 80 columns
set colorcolumn=80
highlight ColorColumn ctermbg=235 guibg=#2c2d27
" Check the function above, these
" are my default values
set tabstop=4
set shiftwidth=4
set expandtab