-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
136 lines (109 loc) · 2.66 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
" Load Pathogen
execute pathogen#infect()
" No Swap File
set noswapfile
" Enables Syntax Highlighting
syntax enable
" Map leader key
let mapleader=","
" Displays mode at bottom of screen
set showmode
" Set autoindent
set autoindent
set smartindent
set wrap
" Show line numbers
set number
noremap <Leader>r :set relativenumber<CR>
noremap <Leader>R :set norelativenumber<CR>
" Set tab to be 2 spaces
set shiftwidth=2
set softtabstop=2
set expandtab
set smarttab
" Set TAB for makefiles
autocmd FileType make setlocal noexpandtab
" Set syntax=yaml for sls files
autocmd BufNewFile,BufRead,BufReadPost *.sls set syntax=yaml
" Set Colorscheme
set bg=dark
colorscheme pablo
set t_Co=256
" Enable file reloading
set autoread
" Don't create backup files
set nobackup
" Searching options
set nohlsearch
set ignorecase
set smartcase
set magic
noremap <Leader>s :set hlsearch<CR>
noremap <Leader>S :set nohlsearch<CR>
" Show matching brackets
set showmatch
" Map W and Q
cmap W w
cmap Q q
noremap ; :
" Better split movement
noremap <Leader>\ :vsplit<CR>
noremap <Leader>/ :split<CR>
noremap <Leader>h <c-w>h
noremap <Leader>j <c-w>j
noremap <Leader>k <c-w>k
noremap <Leader>l <c-w>l
" Statusbar
set laststatus=2
set statusline=%n\:%F "show current buffer and file path
set statusline+=%m\ -\ %y "show if modifiable and filetype
set statusline+=%= "splitpont
set statusline+=%< "truncation point
set statusline+=%{strftime(\"%a\ %m-%b-%y\ %H:%M\")}\ -\ "show time
set statusline+=%{&ff}\ \-\ "file type
set statusline+=%l,%c\ %P "ruler
" Printheader
set pheader=%t\ --\ %Y "file path and type
set pheader+=%=
set pheader+=\ Last\ edit:\ "last edit
set pheader+=%{strftime(\"%a\ %m-%b-%y\ %H:%M:%S\",getftime(expand(\"%%\")))} "time of last edit
set pheader+=\ --\ Page\ %N "Page number
" Spellcheck
noremap <Leader>c :set nospell<CR>
noremap <Leader>C :setlocal spell spelllang=en_us<CR>
" Smash escape
"inoremap jh <Esc>
"inoremap hj <Esc>
"inoremap jk <Esc>
"inoremap kj <Esc>
"inoremap kl <Esc>
"inoremap lk <Esc>
inoremap <Leader>, <Esc>
" WordWrap
noremap <Leader>p :set wrap !<CR>
" Colorcolumn
noremap <Leader>w :set cc=0<CR>
noremap <Leader>W :set cc=80<CR>
" file and autocomplete
set path+=**
set wildmenu
" enable mouse support
"set mouse=a
" remapped keys
inoremap { {}<Left>
inoremap {<CR> {<CR>}<Esc>O
inoremap {{ {
inoremap {} {}
inoremap ( ()<Left>
"inoremap (<CR> (<CR>)<Esc>O
inoremap (( (
inoremap () ()
inoremap [ []<Left>
"inoremap [<CR> [<CR>]<Esc>O
inoremap [[ [
inoremap [] []
" ^x^f = autocomplete files
" ^x^] = autocomplete tags
" ^n = autocomplete from file
" gf = open file under cursor
" gd = go to local definition (functions and vars)