-
Notifications
You must be signed in to change notification settings - Fork 2
/
vimrc
114 lines (91 loc) · 3.18 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
103
104
105
106
107
108
109
110
111
112
113
114
set nocompatible " be iMproved, required
filetype off " required
if $SHELL =~ 'bin/fish'
set shell=/bin/bash
endif
"-----------VUNDLE CONFIG--------------"
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
source ~/.vim/plugins.vim
call vundle#end() " required
filetype plugin indent on " required
"--------------------------------------"
" GENERAL CONFIG {
set backspace=indent,eol,start " regular backspace (could be improved)
set mouse=a " Automatically enable mouse usage
set mousehide
syntax on
set incsearch " Find as you type search
set hlsearch " Highlight search terms
set number " enable line numbers
set t_Co=256 " set terminal to 256 colors
set showcmd " show partial commands
set wildmenu " show autocomplete list
colorscheme zenburn
" }
" FORMATTING {
set nowrap " Do not wrap long lines
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
set splitright " Puts new vsplit windows to the right of the current
set splitbelow " Puts new split windows to the bottom of the current
"set matchpairs+=<:> " Match, to be used with %
set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
"INDENTATION
set autoindent
set tabstop=2
set expandtab
set shiftwidth=2
"autocmd FileType go autocmd BufWritePre <buffer> Fmt
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
" Workaround vim-commentary for Haskell
autocmd FileType haskell setlocal commentstring=--\ %s
" Workaround broken colour highlighting in Haskell
autocmd FileType haskell,rust setlocal nospell
" }
" MAPPINGS {
let mapleader = ","
let g:mapleader = ","
" shift key fixes
command! -bang -nargs=* -complete=file E e<bang> <args>
command! -bang -nargs=* -complete=file W w<bang> <args>
command! -bang -nargs=* -complete=file Wq wq<bang> <args>
command! -bang -nargs=* -complete=file WQ wq<bang> <args>
command! -bang Wa wa<bang>
command! -bang WA wa<bang>
command! -bang Q q<bang>
command! -bang QA qa<bang>
command! -bang Qa qa<bang>
cmap Tabe tabe
" }
" PLUGINS {
let g:snipMate = { 'snippet_version' : 1 }
" ctrlP {
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'ra'
" }
" airline {
set laststatus=2
" }
" nerdtree {
map <leader>n :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" }
"
" HARDMODE {
let g:HardMode_level = 'wannabe'
nnoremap <leader>h <Esc>:call ToggleHardMode()<CR>
" }
" }
"
" load vimrc.local
if filereadable(glob("~/.vimrc.local"))
source ~/.vimrc.local
endif
function SevimEdit()
split ~/.vimrc
endfunction
command SevimEdit call SevimEdit()