- " These settings first
- filetype off
- call pathogen#infect()
- call pathogen#helptags()
- call pathogen#runtime_append_all_bundles()
- " Call other cool features
- runtime macros/matchit.vim
- " Filetype on
- filetype on
- filetype plugin on
- "filetype indent on
- syntax on
- " Tabstops are 2 spaces
- set tabstop=2
- set shiftwidth=2
- set softtabstop=2
- set expandtab
- set autoindent
- " Other settings
- set smartindent
- set showmatch
- set wrap
- set linebreak
- set showmode
- set autoread
- set hidden
- set backspace=indent,eol,start
- set equalalways "Splits always equal
- " Set folds
- set foldmethod=marker
- set foldcolumn=1
- " TAB completions
- set wildmenu
- set wildmode=list:longest
- " Searching
- nnoremap / /\v
- vnoremap / /\v
- set hlsearch
- set incsearch
- set showmatch
- set ignorecase
- set smartcase
- set gdefault
- "" This clears searches. thank god.
- nnoremap <leader><space> :noh<cr>
- "" Not exactly searching, but it's good
- nnoremap <tab> %
- vnoremap <tab> %
- " Allow writing to files with root privileges
- cmap w!! w !sudo tee % > /dev/null
- " Status Line
- set stl=[%f%Y%M]%=[%n::%l/%L(%p%%)::%c]
- set laststatus=2
- set showcmd
- set noruler
- "" GUI Options
- "set guioptions=aAcgimTr
- """ Font
- "set gfn=Inconsolata\ Medium\ 12
- " Solarized scheme
- set background=dark
- colorscheme solarized
- " Other Look Stuff
- set scrolloff=8
- set cursorline
- set nocursorcolumn
- set title
- set shortmess=at
- "" To be ready for 7.3!
- set number
- "set relativenumber
- " Swap File Allocation
- set backupdir=~/.vim-tmp,/var/tmp,/tmp
- set directory=~/.vim-tmp,/var/tmp,/tmp
- " MAP LEADER
- let mapleader = ","
- " Keymaps - Normal mode
- nnoremap k gk
- nnoremap j gj
- "" Keymaps - windows
- nnoremap <leader><tab> <C-w>v<C-w>l
- nnoremap <C-h> <C-w>h
- nnoremap <C-j> <C-w>j
- nnoremap <C-k> <C-w>k
- nnoremap <C-l> <C-w>l
- "nnoremap <C-S-h> <C-w><
- "nnoremap <C-S-j> <C-w>-
- "nnoremap <C-S-k> <C-w>+
- "nnoremap <C-S-l> <C-w>>
- "" Switch ` and '
- nnoremap ` '
- nnoremap ' `
- nnoremap Y y$
- " Keymaps - Insert mode
- "" map jj to enter Normal mode
- inoremap jj <ESC>
- " Keymaps - to cure annoying shit
- inoremap <F1> <ESC>
- nnoremap <F1> <ESC>
- vnoremap <F1> <ESC>
- nnoremap ; :
- "--------------------- Autocorrect ------------------------
- iab teh the
- iab Teh The
- iab taht that
- iab Taht That
- iab alos also
- iab Alos Also
- iab aslo also
- iab Aslo Also
- iab becuase because
- iab Becuase Because
- iab bianry binary
- iab Bianry Binary
- iab bianries binaries
- iab Bianries Binaries
- iab charcter character
- iab Charcter Character
- iab charcters characters
- iab Charcters Characters
- iab exmaple example
- iab Exmaple Example
- iab exmaples examples
- iab Exmaples Examples
- iab shoudl should
- iab Shoudl Should
- iab seperate separate
- iab Seperate Separate
- iab fone phone
- iab Fone Phone
- "----------------------------------------------------------
- "--------------------- Plugins Settings ------------------
- " NERD Tree Settings
- "" Toggle it on/off with \
- nnoremap \ :NERDTreeToggle<CR>
- "" To Quit when NERDTree is only buffer
- function! NERDTreeQuit()
- redir => buffersoutput
- silent buffers
- redir END
- let pattern = '^\s*\(\d\+\)\(.....\) "\(.*\)"\s\+line \(\d\+\)$'
- let windowfound = 0
- for bline in split(buffersoutput, "\n")
- let m = matchlist(bline, pattern)
- if (len(m) > 0)
- if (m[2] =~ '..a..')
- let windowfound = 1
- endif
- endif
- endfor
- if (!windowfound)
- quitall
- endif
- endfunction
- autocmd WinEnter * call NERDTreeQuit()
- " NERD Comment Settings
- nmap <C-c> <plug>NERDCommenterToggle
- " ZEN Coding Settings
- "" Mappings
- " --------------------------------------------------------
- " Functions
- function ModeChange()
- if getline(1) =~ "^#!"
- if getline(1) =~ "/bin/"
- silent !chmod a+x <afile>
- endif
- endif
- endfunction
- au BufWritePost * call ModeChange()
Posted by mahatman2 on Sun 27th Nov 05:11 (modification of post by view diff)
download | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.