-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
96 lines (81 loc) · 3.12 KB
/
.vimrc
File metadata and controls
96 lines (81 loc) · 3.12 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
" activate pathogen
runtime bundle/vim-pathogen/autoload/pathogen.vim
call pathogen#infect()
" reset to vim-defaults
set nocompatible
" indent
filetype plugin indent on
set expandtab
set shiftwidth=2
set softtabstop=2
" display settings
set background=dark " solized @ dark
set scrolloff=3 " 3 lines above/below cursor when scrolling
set number " show line numbers
set showmatch " show matching bracket (briefly jump)
set showmode " show mode in status bar (insert/replace/...)
set showcmd " show typed command in status bar
set ruler " show cursor position in status bar
set title " show file in titlebar
set wildmenu " completion with menu
" editor settings
set ignorecase " case insensitive searching
set autoindent " dito
set smarttab " smart tab handling for indenting
set smartcase " but become case sensitive if you type uppercase characters
set magic " change the way backslashes are used in search patterns
set bs=indent,eol,start " Allow backspacing over everything in insert mode
set nobackup " no backup~ files.
set mouse=a " use mouse to select stuff
set nowrap " do not wrap long lines
set hidden " when switching buffers: hide & preserve history
" nice statusbar
set laststatus=2
set statusline=
set statusline+=%-3.3n\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%m%r%w " flags
set statusline+=\[%{strlen(&ft)?&ft:'none'}\] " filetype
set statusline+=\ \[%{&encoding}, " encoding
set statusline+=%{&fileformat}] " file format
set statusline+=%= " right align
set statusline+=0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
" some specials
set listchars=tab:▸\ ,eol:¬ " Use custom symbols for tabstops and EOLs
set showbreak=…
" all swap files in single folder
set directory=~/.vim_swap//
" colors & syntax
if &t_Co > 2 || has("gui_running")
syntax on " enable colors
set hlsearch " highlight search (very useful!)
set hl=l:Visual " change highlight-color of hlsearch
set incsearch " search incremently (search while typing)
color solarized
endif
" When switching buffers, preserve window view.
if v:version >= 700
au BufLeave * let b:winview = winsaveview()
au BufEnter * if exists('b:winview') | call winrestview(b:winview) | endif
endif
"ComandT
map <C-t> :CommandT<CR>
map <C-b> :CommandTBuffer<CR>
" Map ctrl-movement keys to window switching
map <C-k> <C-w><Up>
map <C-j> <C-w><Down>
map <C-l> <C-w><Right>
map <C-h> <C-w><Left>
" toggle set list
nmap <F12> :set list!<CR>
" ruby-files
au BufRead,BufNewFile {Gemfile,Rakefile,Guardfile,config.ru,Thorfile} set ft=ruby
" custom commands
command C let @/=''
" correct behavior
augroup NO_CURSOR_MOVE_ON_FOCUS
au!
au FocusLost * let g:oldmouse=&mouse | set mouse=
au FocusGained * if exists('g:oldmouse') | let &mouse=g:oldmouse | unlet g:oldmouse | endif
augroup END