-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
86 lines (77 loc) · 1.83 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
" Pathogen package management
execute pathogen#infect()
" Solarized colors
syntax enable
"set background=dark
"colorscheme solarized
" Custom python folding
source ~/.vim/folding.vim
" To recognize filetypes?
:filetype on
" My preferred settings
set nowrap
set number
set mouse=a
set splitright
set splitbelow
set ls=2
set tabstop=2
set nrformats=hex
set ignorecase
set smartcase
set incsearch
set t_Co=16 "Allow bright colors without bold
set hidden "Allow switching from an unsaved buffer
" Map leaders
let mapleader = "'"
let maplocalleader = ","
" Bindings
nnoremap <leader>ev :vnew $MYVIMRC <cr>
nnoremap <leader>hv :new $MYVIMRC <cr>
nnoremap <leader>sv :source $MYVIMRC <cr>
nnoremap <localleader>w :set wrap! <cr>
inoremap jk <esc>
vnoremap jk <esc>
nnoremap H 0
nnoremap J L
nnoremap K H
nnoremap L $
vnoremap H 0
vnoremap J L
vnoremap K H
vnoremap L $
nnoremap <leader>k <C-W>k
nnoremap <leader>j <C-W>j
nnoremap <leader>l <C-W>l
nnoremap <leader>h <C-W>h
nnoremap Y y$
nnoremap <leader><space> :noh<cr>
nnoremap <leader>s :windo set scrollbind!<cr>
nnoremap <Up> <C-W>+
nnoremap <Down> <C-W>-
" Filetype specific things
:autocmd FileType python nnoremap <buffer><localleader>c I#@ <esc>
:autocmd FileType python :set foldmethod=expr
:autocmd FileType python :set foldexpr=GetPythonFold(v:lnum)
:autocmd FileType python :set foldcolumn=1
:autocmd FileType sh nnoremap <buffer><localleader>c I#<esc>
:autocmd FileType sh nnoremap <buffer><localleader>C 0x<esc>
:autocmd BufNewFile *.sh 0r ~/.vim/skeletons/skeleton.sh
:autocmd FileType txt :set tw 80
:autocmd FileType txt :set formatoptions+=t
" Vimdiff colorscheme
if &diff
colorscheme vimdiff
endif
" Not often used
"
" For :sh command?
" set shell=bash\ --login
"
" Move line down / up
nnoremap - ddp
nnoremap _ ddkP
"
" Make word upper case
inoremap <c-u> <esc>viwUi
nnoremap <c-u> viwU