3 [[wp>Vim]] is an wonderful editor. You have to spent some time to get used to this, but since then you will gain much more in produtivity.
5 ===== How to change vim configuration =====
7 The file ~/.vimrc is read and executed every time you open vim. So if you want that a configuration change (like set number) to be true the next time you open vim, you must append it to the ~/.vimrc. Here is an example code:
11 $ echo 'set number' >> ~/.vimrc
14 ===== Useful Vim Configurations =====
16 Download my [[http://www.inf.ufrgs.br/~kssilveira/.vimrc|.vimrc]] file and do the following:
20 $ echo ':source path/to/my/vimrc/file/on/your/pc' >> ~/.vimrc
23 This loads my .vimrc file everytime you open Vim.
25 These are the extra configurations I use:
36 " indentation size (used on auto indentation)
38 " smart indentation (indent beginning of blocks (e.g. '{') and unnindent ending of blocks (e.g. '}'))
41 map! <C-s> <Esc>:w<CR>
44 map! <F9> <Esc>:make<CR><CR>
45 map <F9> <Esc>:make<CR><CR>
52 " reload file automatically when it changes
54 " call make -B with F8
55 map! <F8> <Esc>:make -B<CR><CR>
56 map <F8> <Esc>:make -B<CR><CR>
59 If the save with Ctrl+S isn't working, maybe you have to change your bash configuration (see [[Bash]]).
63 [[vim::commands|Vim Commands]]
65 ===== Edit-Compile-Execute Cycle =====
67 | :mks(ession) | create a session file |
68 | vim -S | load a session file |
70 | :mak(e) | run make |
71 | :cl(ist) | show make output |
72 | :cope(n) | open a window with make output |
73 | :cn(ext) | go to next error |
74 | :cp(revious) | go to previous error |
75 | :cc | go to current error |
76 | :ccl(ose) | close the window with make output |
78 | Ctrl+O | go to previous edition |
79 | Ctrl+I | go to next edition |