Skip to content
Newer
Older
100644 105 lines (75 sloc) 3.76 KB
b991bc7 @aq Vim configuration files.
authored Mar 7, 2011
1 " no compatible with the old vi.
2 set nocompatible " Must come first because it changes other options.
3
4 " load pathogen plugin manager
5 filetype off
6 call pathogen#helptags()
7 call pathogen#runtime_append_all_bundles()
8
9 let mapleader = ","
10
11 syntax enable " Turn on syntax highlighting.
12 filetype plugin indent on " Turn on file type detection.
13
14 runtime macros/matchit.vim " Load the matchit plugin.
15
16 set showcmd " Display incomplete commands.
17 set showmode " Display the mode you're in.
18
19 set backspace=indent,eol,start " Intuitive backspacing.
20
21 set hidden " Handle multiple buffers better.
22
23 set wildmenu " Enhanced command line completion.
24 set wildmode=list:longest " Complete files like a shell.
25
26 set ignorecase " Case-insensitive searching.
27 set smartcase " But case-sensitive if expression contains a capital letter.
28
29 set number " Show line numbers.
30 set ruler " Show cursor position.
31
32 set incsearch " Highlight matches as you type.
33 set hlsearch " Highlight matches.
34
35 set wrap " Turn on line wrapping.
36 set scrolloff=3 " Show 3 lines of context around the cursor.
37
38 set title " Set the terminal's title
39
40 set nobackup " Don't make a backup before overwriting a file.
41 set nowritebackup " And again.
42 set directory=$HOME/.vim/tmp//,. " Keep swap files in one location
43
44 set tabstop=2 " Global tab width.
45 set shiftwidth=2 " And again, related.
46 set expandtab " Use spaces instead of tabs
47
48 set laststatus=2 " Show the status line all the time
49 " Useful status information at bottom of screen
50 set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
51
52 " Use vividchalk
53 colorscheme vividchalk
54
55 " Tab mappings.
56 " map <leader>tt :tabnew<cr>
57 " map <leader>te :tabedit
58 " map <leader>tc :tabclose<cr>
59 " map <leader>to :tabonly<cr>
60 " map <leader>tn :tabnext<cr>
61 " map <leader>tp :tabprevious<cr>
62 " map <leader>tf :tabfirst<cr>
63 " map <leader>tl :tablast<cr>
64 " map <leader>tm :tabmove
65
66 " Uncomment to use Jamis Buck's file opening plugin
67 " map <Leader>t :FuzzyFinderTextMate<Enter>
68
69 " Automatic fold settings for specific files. Uncomment to use.
70 " autocmd FileType ruby setlocal foldmethod=syntax
71 " autocmd FileType css setlocal foldmethod=indent shiftwidth=2 tabstop=2
72
73 let g:ackprg="ack-grep -H --nocolor --nogroup --column"
74
75 :vmap <Tab> >gv
76 :vmap <S-Tab> <gv
4af8edd @aq Get CommandT shortcuts.
authored Jul 17, 2011
77
78 " Switch between the 2 last files.
79 map <leader><leader> <c-^>
80
81
82 " Custom CommandT Rails mapping
83 map <leader>gv :CommandTFlush<cr>\|:CommandT app/views<cr>
84 map <leader>gc :CommandTFlush<cr>\|:CommandT app/controllers<cr>
85 map <leader>gm :CommandTFlush<cr>\|:CommandT app/models<cr>
86 map <leader>gh :CommandTFlush<cr>\|:CommandT app/helpers<cr>
87 map <leader>gl :CommandTFlush<cr>\|:CommandT lib<cr>
88 map <leader>gp :CommandTFlush<cr>\|:CommandT public<cr>
89 map <leader>gs :CommandTFlush<cr>\|:CommandT public/stylesheets<cr>
90
91 " Edit or view files in same directory as current file
92 cnoremap %% <C-R>=expand('%:h').'/'<cr>
93 map <leader>e :edit %%
94 map <leader>v :view %%
95
96 " Open CommandT in the directory of the last file.
97 map <leader>gf :CommandTFlush<cr>\|:CommandT %%<cr>
cb39ed2 @aq Format a line with an array with vim.
authored Jul 22, 2011
98
99 " format a line with an end array in ruby.
100 map Q :s/^\(.*\)$/\1EndOfLine/g\|gv\|:s/, /,\r/g<cr>\|''\|v\|/EndOfLine<cr>\|:Align =><cr>\|gv\|:s/EndOfLine//<cr>\|gv\|=
7ccbc0a @aq Coffeescript, Gitignore and xfce.
authored Dec 11, 2011
101
102 " formating for coffeescript
103 au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable
104 au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
Something went wrong with that request. Please try again.