general.vim 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. " Be IMproved
  2. if &compatible
  3. set nocompatible
  4. endif
  5. " set leader key
  6. let g:mapleader="\\"
  7. " alias for leader key
  8. nmap <space> \
  9. xmap <space> \
  10. syntax enable " Enables syntax highlighing
  11. set hidden " Required for specific actions that require multiple buffers
  12. set nowrap " display long lines as just one line
  13. set encoding=utf-8 " The encoding displayed
  14. set pumheight=10 " Makes popup menu smaller
  15. set fileencoding=utf-8 " The encoding written to file
  16. set ruler " show the cursor position all the time
  17. set iskeyword+=- " treat dash separated words as a word text object"
  18. set mouse=a " Enable your mouse
  19. set splitbelow " Horizontal splits will automatically be below
  20. set splitright " Vertical splits will automatically be to the right
  21. set t_Co=256 " Support 256 colors
  22. set autochdir " Your working directory will always be the same as your working directory
  23. :set conceallevel=0 " So that I can see `` in markdown files
  24. set tabstop=2 " Insert 2 spaces for a tab
  25. set shiftwidth=2 " Change the number of space characters inserted for indentation
  26. set smarttab " Makes tabbing smarter will realize you have 2 vs 4
  27. set expandtab " Converts tabs to spaces
  28. set smartindent " Makes indenting smart
  29. set autoindent " Good auto indent
  30. set laststatus=2 " Always display the status line
  31. set number " Line numbers
  32. set cursorline " Enable highlighting of the current line
  33. set background=dark " tell vim what the background color looks like
  34. let g:python_highlight_all = 0 " Get rid of annoying red highlights"
  35. let g:elite_mode=1 " Disable arrows"
  36. filetype plugin indent on " Gives vim abilty to recognize filetypes
  37. " Disable arrow movement, resize splits instead.
  38. if get(g:, 'elite_mode')
  39. nnoremap <Up> :resize -2<CR>
  40. nnoremap <Down> :resize +2<CR>
  41. nnoremap <Left> :vertical resize -2<CR>
  42. nnoremap <Right> :vertical resize +2<CR>
  43. endif
  44. " Alternate way to save
  45. nnoremap <C-s> :w<CR>
  46. " Alternate way to quit
  47. nnoremap <C-Q> :wq!<CR>
  48. " Use control-c instead of escape
  49. nnoremap <C-c> <Esc>
  50. " <TAB>: completion.
  51. inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  52. " Open terminal with F1
  53. nnoremap <silent> <F1> :10split term://bash<CR>
  54. nnoremap <silent> <F2> :bdelete! term://*<return>
  55. nnoremap <C-h> <C-w>h
  56. nnoremap <C-j> <C-w>j
  57. nnoremap <C-k> <C-w>k
  58. nnoremap <C-l> <C-w>l
  59. " Remap terminal switch
  60. tnoremap <C-[> <C-\><C-n>
  61. tnoremap <C-c><Esc> <Esc>
  62. tnoremap <C-h> <C-\><C-n><C-w>h
  63. tnoremap <C-j> <C-\><C-n><C-w>j
  64. tnoremap <C-k> <C-\><C-n><C-w>k
  65. tnoremap <C-l> <C-\><C-n><C-w>l
  66. " TAB in general mode will move to text buffer
  67. nnoremap <TAB> :bnext<CR>
  68. " SHIFT-TAB will go back
  69. nnoremap <S-TAB> :bprevious<CR>