Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 174 lines (137 sloc) 4.63 kb
17f7f7b Initial checkin
Andrey Paramonov authored
1 " ------------------------------------------------------------------------------
2 "
3 " Andrey Paramonov's Vim Configuration
4 "
5 " It's based on smart guys' configurations:
6 " http://github.com/derekwyatt/vim-config
7 " http://mislav.uniqpath.com/2011/12/vim-revisited
8 " http://stevelosh.com/blog/2010/09/coming-home-to-vim
9df48a6 Better history
Andrey Paramonov authored
9 " http://ciaranm.wordpress.com/2008/05/15/my-vimrc/
17f7f7b Initial checkin
Andrey Paramonov authored
10 "
11 " ------------------------------------------------------------------------------
12
13 syntax on
1d2ab4a Additional settings for VimClojure
Andrey Paramonov authored
14 filetype plugin indent on
17f7f7b Initial checkin
Andrey Paramonov authored
15
16 set nocompatible
17 set encoding=utf-8
18 set modelines=0
19
20 " When the page starts to scroll, keep the cursor 8 lines from the top and 8
21 " lines from the bottom
274b4bd Fugitive plugin
Andrey Paramonov authored
22 set scrolloff=4
17f7f7b Initial checkin
Andrey Paramonov authored
23
9df48a6 Better history
Andrey Paramonov authored
24 " Enable a nice big viminfo file
25 set viminfo='1000,f1,:1000,/1000
26 set history=500
27
17f7f7b Initial checkin
Andrey Paramonov authored
28 " Tabulation options
29 set tabstop=4
30 set shiftwidth=4
31 set softtabstop=4
32 set expandtab
33
34 " Indentation options for programming
35 set autoindent
36 set smartindent
37
38 " Show the current mode
39 set showmode
40
41 " Display incomplete commands
42 set showcmd
43
44 " Make sure that unsaved buffers that are to be put in the background are
b69d4f7 Comments and minor cleanup
Andrey Paramonov authored
45 " allowed to go in there (ie. the 'must save first' error doesn't come up)
17f7f7b Initial checkin
Andrey Paramonov authored
46 set hidden
47
48 " Make the command-line completion better
49 set wildmenu
50 set wildmode=list:longest
51
52 " Allow backspacing over indent, eol, and the start of an insert
53 set backspace=indent,eol,start
54
55 " Always put a status line in, even if there is only one window
56 set laststatus=2
274b4bd Fugitive plugin
Andrey Paramonov authored
57 set statusline=%f\ %m\ %r\ Line:%l/%L[%p%%]\ Col:%v\ Buf:#%n\ [%b][0x%B]\ %{fugitive#statusline()}
17f7f7b Initial checkin
Andrey Paramonov authored
58
59 " Make the 'cw' and like commands put a $ at the end instead of just deleting
60 " the text and replacing it
61 set cpoptions+=$
62
85b0d8a Few minor changes
Andrey Paramonov authored
63 " Show line numbers
17f7f7b Initial checkin
Andrey Paramonov authored
64 set number
65
66 " Add the unnamed register to the clipboard
67 set clipboard+=unnamed
68
69 " Search options
70 set ignorecase
71 set smartcase
85b0d8a Few minor changes
Andrey Paramonov authored
72 "set gdefault
17f7f7b Initial checkin
Andrey Paramonov authored
73 set incsearch
74 set showmatch
75 set hlsearch
76
77 "set path=.,~/projects/**
78
79 " ------------------------------------------------------------------------------
80 " Train myself not to use arrow keys
81 " ------------------------------------------------------------------------------
82
83 nnoremap <up> <nop>
84 nnoremap <down> <nop>
85 nnoremap <left> <nop>
86 nnoremap <right> <nop>
87 inoremap <up> <nop>
88 inoremap <down> <nop>
89 inoremap <left> <nop>
90 inoremap <right> <nop>
91
92 " ------------------------------------------------------------------------------
93 " My custom settings
94 " ------------------------------------------------------------------------------
95
96 let mapleader = ","
97
98 nnoremap <leader><space> :noh<cr>
99 nnoremap <tab> %
100 vnoremap <tab> %
101
102 nnoremap <leader>a :Ack
1d2ab4a Additional settings for VimClojure
Andrey Paramonov authored
103 nnoremap <leader>c y%
104 nnoremap <leader>x d%
a0b0a4d Map ,s -> :%s/
Andrey Paramonov authored
105 nnoremap <leader>s :%s/
17f7f7b Initial checkin
Andrey Paramonov authored
106
107 nnoremap ; :
108
109 nnoremap <leader>v V`]
110
b69d4f7 Comments and minor cleanup
Andrey Paramonov authored
111 " In normal mode, jj escapes
17f7f7b Initial checkin
Andrey Paramonov authored
112 inoremap jj <ESC>
113
114 nnoremap <leader>w <C-w>v<C-w>l
115
116 nnoremap <C-h> <C-w>h
117 nnoremap <C-j> <C-w>j
118 nnoremap <C-k> <C-w>k
119 nnoremap <C-l> <C-w>l
120
b69d4f7 Comments and minor cleanup
Andrey Paramonov authored
121 " Make <space> in normal mode go down a page rather than left a character
122 noremap <space> <C-f>
123
9b2fd14 @ndpar Linewise mapping for j and k
authored
124 " Move up and down on a linewise basis
125 :nmap j gj
126 :nmap k gk
127
85b0d8a Few minor changes
Andrey Paramonov authored
128 " Write the file you don't have permissions to
ff8f982 @ndpar sudow
authored
129 cnoremap sudow w !sudo tee % >/dev/null
85b0d8a Few minor changes
Andrey Paramonov authored
130
1d2ab4a Additional settings for VimClojure
Andrey Paramonov authored
131 " VimClojure
132 let g:vimclojure#HighlightBuiltins = 1
133 let g:vimclojure#ParenRainbow = 1
4e4a10b Shorter indent for Lisp words
Andrey Paramonov authored
134 let g:vimclojure#FuzzyIndent = 1
1d2ab4a Additional settings for VimClojure
Andrey Paramonov authored
135
17f7f7b Initial checkin
Andrey Paramonov authored
136 " ------------------------------------------------------------------------------
137 " GUI settings
138 " ------------------------------------------------------------------------------
139
140 if has("gui_running")
141 set guioptions-=m " get rid of menue
142 set guioptions-=T " get rid of toolbar
143 set guioptions-=L " get rid of left scrollbar
144 set guioptions-=r " get rid of right scrollbar
145 set guioptions-=b " get rid of bottom scrollbar
146 set go-=L " get rid of left split scrollbar
147 set go-=r " get rid of right split scrollbar
148 colorscheme xoria256 " make sure you have this scheme in ~/.vim/colors
149 if has("window")
150 set guifont=lucida_console:h8
151 elseif has("mac")
152 set guifont=menlo:h12
153 endif
154 if !exists("g:vimrcloaded")
155 winpos 0 0
156 set lines=63 " make it full screen on my MacBook
157 set columns=205
158 let g:vimrcloaded = 1
159 endif
160 else
161 "set t_Co=256
2881d38 @ndpar github color scheme
authored
162 colorscheme github
17f7f7b Initial checkin
Andrey Paramonov authored
163 endif
164
ceac873 Nice window title
Andrey Paramonov authored
165 " Nice window title
166 if has('title') && (has('gui_running') || &title)
167 set titlestring=
168 set titlestring+=%f\ " file name
169 set titlestring+=%h%m%r%w " flags
170 set titlestring+=\ -\ %{v:progname} " program name
171 set titlestring+=\ -\ %{substitute(getcwd(),\ $HOME,\ '~',\ '')} " working directory
172 endif
173
Something went wrong with that request. Please try again.