Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 123 lines (95 sloc) 3.452 kB
0447e6c @marcelcastilho Improvements that I learned running through some tutorials.
authored
1 " credits:
2 " http://nvie.com/posts/how-i-boosted-my-vim/
3 " http://stevelosh.com/blog/2010/09/coming-home-to-vim/s
8d2a309 @marcelcastilho Better status line.
authored
4 " http://wekeroad.com/2010/07/29/vim-is-your-daddy/
0447e6c @marcelcastilho Improvements that I learned running through some tutorials.
authored
5 " http://derekwyatt.org/vim/vim-tutorial-videos/vim-novice-tutorial-videos/
6
7 " use Vim settings, rather then Vi settings (much better!).
8 " this must be first, because it changes other options as a side effect.
9 set nocompatible
83a05c5 @marcelcastilho Minor adjustments. Plugins to come.
authored
10
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
11 " quickly edit/reload the vimrc file
12 nmap <silent> <leader>ev :e $MYVIMRC<cr>
13 nmap <silent> <leader>sv :so $MYVIMRC<cr>
14
0447e6c @marcelcastilho Improvements that I learned running through some tutorials.
authored
15 " use pathogen (https://github.com/tpope/vim-pathogen)
16 " to easily modify the runtime path to include all
17 " plugins under the ~/.vim/bundle directory
18 call pathogen#helptags()
19 call pathogen#runtime_append_all_bundles()
6ba248f @marcelcastilho Starting the action...
authored
20
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
21 " (...) never ever let Vim write a backup file! They did that in the 70’s...
22 set nobackup
23 set noswapfile
24
25 " hide buffers when not displayed
26 set hidden
27
0447e6c @marcelcastilho Improvements that I learned running through some tutorials.
authored
28 " incsearch, showmatch and hlsearch work together to highlight search results (as you type).
29 " It’s really quite handy, as long as you have the next line as well.
30 set incsearch
31 set showmatch
32 set hlsearch
33
34 " ignorecase and smartcase together make Vim deal with case-sensitive search intelligently.
35 " if you search for an all-lowercase string your search will be case-insensitive,
36 " but if one or more characters is uppercase the search will be case-sensitive.
37 " most of the time this does what you want.
38 set ignorecase
39 set smartcase
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
40
41 " allow backspacing over everything in insert mode
6ba248f @marcelcastilho Starting the action...
authored
42 set backspace=indent,eol,start
43
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
44 " store lots of :cmdline history
6ba248f @marcelcastilho Starting the action...
authored
45 set history=1000
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
46
47 " colors and fonts
6ba248f @marcelcastilho Starting the action...
authored
48 colorscheme vividchalk
49
50 if has("gui_running")
51 if has("gui_gtk2")
52 set guifont=Inconsolata\ 12
53 elseif has("gui_win32")
0447e6c @marcelcastilho Improvements that I learned running through some tutorials.
authored
54 set guifont=Consolas:h10:cANSI
6ba248f @marcelcastilho Starting the action...
authored
55 endif
56 endif
57
0447e6c @marcelcastilho Improvements that I learned running through some tutorials.
authored
58 " http://vim.wikia.com/wiki/Hide_toolbar_or_menus_to_see_more_text
59 " remove menu bar/toolbar/right-hand scroll bar
60 :set guioptions-=m
61 :set guioptions-=T
62 :set guioptions-=r
63
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
64 " line numbers
6ba248f @marcelcastilho Starting the action...
authored
65 set number
66
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
67 " indent settings
6ba248f @marcelcastilho Starting the action...
authored
68 set shiftwidth=4
69 set softtabstop=4
70 set expandtab
71 set autoindent
72
83a05c5 @marcelcastilho Minor adjustments. Plugins to come.
authored
73 " switch to paste mode, disabling all kinds of smartness
74 " and just pasting a whole buffer of text
75 set pastetoggle=<F2>
76
77 " some stuff to get the mouse going in term
78 set mouse=a
79
8d2a309 @marcelcastilho Better status line.
authored
80 " make the 'cw' and like commands put a $ at the end instead of just deleting
81 " the text and replacing it
0447e6c @marcelcastilho Improvements that I learned running through some tutorials.
authored
82 set cpoptions+=$
83
8d2a309 @marcelcastilho Better status line.
authored
84 " make command line two lines high
85 set ch=2
86
87 " set the status line the way i (derekwyatt) like it
88 set stl=%f\ %m\ %r%{fugitive#statusline()}\ Line:%l/%L[%p%%]\ Col:%v\ Buf:#%n\ [%b][0x%B]
89
90 " tell VIM to always put a status line in, even if there is only one window
91 set laststatus=2
92
eb0f304 @marcelcastilho wildmenu
authored
93 " make the command-line completion better
94 set wildmenu
95
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
96 " turn on syntax highlighting
6ba248f @marcelcastilho Starting the action...
authored
97 syntax on
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
98
0447e6c @marcelcastilho Improvements that I learned running through some tutorials.
authored
99 " load ftplugins and indent files
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
100 filetype plugin on
101 filetype indent on
102
0447e6c @marcelcastilho Improvements that I learned running through some tutorials.
authored
103 " if you are still getting used to Vim and want to force yourself to stop using the arrow keys
104 nnoremap <up> <nop>
105 nnoremap <down> <nop>
106 nnoremap <left> <nop>
107 nnoremap <right> <nop>
108 inoremap <up> <nop>
109 inoremap <down> <nop>
110 inoremap <left> <nop>
111 inoremap <right> <nop>
112
113 " if you like long lines with line wrapping enabled,
114 " this solves the problem that pressing down jumpes your cursor “over” the current line to the next line.
115 " it changes behaviour so that it jumps to the next row in the editor (much more natural)
116 nnoremap j gj
117 nnoremap k gk
118
119 " make ; do the same thing as :
120 " it’s one less key to hit every time I want to save a file
121 nnoremap ; :
8426d84 @marcelcastilho Pathogen, nerdtree and editor improvements.
authored
122
Something went wrong with that request. Please try again.