Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " TODO:
- " copy-paste without delete: http://stackoverflow.com/questions/11993851/vim-how-to-delete-not-cut
- " Pathogen
- call pathogen#infect()
- " Misc
- syntax enable
- filetype plugin indent on
- set ic
- set incsearch
- set cindent
- set autochdir
- set wildmenu
- set ignorecase smartcase
- set autoindent
- set virtualedit=all
- set nowrap
- :cabbr desk /Users/maxime/Desktop
- au BufRead,BufNewFile *.md set filetype=markdown
- " Absolute line numbers when we’re in insert mode
- " Relative numbers when we’re in normal mode
- set relativenumber
- autocmd InsertEnter * :set number
- autocmd InsertLeave * :set relativenumber
- " Don't clutter my dirs up with swp and tmp files
- set backupdir=~/.tmp
- set directory=~/.tmp
- " Look
- set background=dark
- colorscheme solarized
- :set guifont=Menlo\ Regular:h18
- " Shortcuts
- let mapleader = ","
- nmap k gk
- nmap j gj
- noremap <Leader>i magg=G`azz
- noremap <Leader>vi :tabe ~/.vimrc<CR>
- noremap <Leader>cs :tabe ~/Code/VimCheatSheet.md<CR>
- noremap <C-F> :tabn<CR>
- noremap <C-D> :tabp<CR>
- noremap <C-A> 30zh
- noremap <C-S> 30zl
- noremap <Leader>r :call RenameFile()<cr>
- " Code folding settings
- set foldmethod=indent "fold based on indent
- set foldnestmax=10 "deepest fold is 10 levels
- set nofoldenable "dont fold by default
- set foldlevel=1 "this is just what i use
- " Autocompletion
- autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
- autocmd FileType php set omnifunc=phpcomplete#CompletePHP
- autocmd FileType css set omnifunc=csscomplete#CompleteCSS
- autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
- " Making autocompletion work with jk
- inoremap <expr> j ((pumvisible())?("\<C-n>"):("j"))
- inoremap <expr> k ((pumvisible())?("\<C-p>"):("k"))
- " Don't add the comment prefix when I hit enter or o/O on a comment line.
- set formatoptions-=or
- " Renaming a file
- function! RenameFile()
- let old_name = expand('%')
- let new_name = input('New file name: ', expand('%'), 'file')
- if new_name != '' && new_name != old_name
- exec ':saveas ' . new_name
- exec ':silent !rm ' . old_name
- redraw!
- endif
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement