general.vim 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. " Be IMproved
  2. if &compatible
  3. set nocompatible
  4. endif
  5. " Gives vim abilty to recognize filetypes
  6. filetype plugin indent on
  7. " Enables syntax highlighing
  8. syntax enable
  9. " display long lines as just one line
  10. set nowrap
  11. " The encoding displayed
  12. set encoding=utf-8
  13. " The encoding written to file
  14. set fileencoding=utf-8
  15. " Enable your mouse
  16. set mouse=a
  17. " Horizontal splits will automatically be below
  18. set splitbelow
  19. " Vertical splits will automatically be to the right
  20. set splitright
  21. " Support 256 colors
  22. set t_Co=256
  23. " Your working directory will always be the same as your working directory
  24. set autochdir
  25. " Insert 4 spaces for a tab
  26. set tabstop=4
  27. " Change the number of space characters inserted for indentation
  28. set shiftwidth=4
  29. " Makes tabbing smarter will realize you have 2 vs 4
  30. set smarttab
  31. " Converts tabs to spaces
  32. set expandtab
  33. " Makes indenting smart
  34. ""set smartindent
  35. " Good auto indent
  36. ""set autoindent
  37. " Always display the status line
  38. set laststatus=2
  39. " Line numbers
  40. set number
  41. " Enable highlighting of the current line
  42. set cursorline
  43. " Get rid of annoying red highlights"
  44. let g:python_highlight_all = 0
  45. " Disable arrows"
  46. let g:elite_mode=1
  47. " Disable arrow movement, resize splits instead.
  48. if get(g:, 'elite_mode')
  49. nnoremap <Up> :resize -2<CR>
  50. nnoremap <Down> :resize +2<CR>
  51. nnoremap <Left> :vertical resize -2<CR>
  52. nnoremap <Right> :vertical resize +2<CR>
  53. endif
  54. " Alternate way to save
  55. nnoremap <C-s> :w<CR>
  56. " Alternate way to quit
  57. nnoremap <C-Q> :wq!<CR>
  58. " Use control-c instead of escape
  59. nnoremap <C-c> <Esc>
  60. " <TAB>: completion.
  61. inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  62. " Open terminal with F1
  63. nnoremap <silent> <F1> :10split term://bash<CR>
  64. " insert mode for terminal
  65. autocmd BufWinEnter,WinEnter term://* startinsert
  66. autocmd BufLeave term://* stopinsert
  67. " Toggle tagbar
  68. nnoremap <silent> <F2> :tagbar<CR>
  69. " Toggle Line numbers
  70. nnoremap <silent> <F4> :set nonumber!<CR>
  71. " Toggle NERDTree
  72. nnoremap <silent> <F5> :NERDTreeToggle<CR>
  73. " Startify
  74. nnoremap <silent> <F6> :Startify<CR>
  75. " Get rid of highlights after search
  76. nnoremap <silent> <F7> :nohlsearch<CR><F7>
  77. " Toggle open buffers
  78. nnoremap <silent> <F8> :BuffergatorToggle<CR>
  79. " For fuzzy finder
  80. nnoremap <silent> <F9> :Files<CR>
  81. " F10 split vertical
  82. nnoremap <silent> <F10> :vsplit<CR>
  83. " F11 split horizontal
  84. nnoremap <silent> <F11> :split<CR>
  85. " Make current buffer only buffer
  86. nnoremap <silent> <F12> :only<CR>
  87. " Remap window switch
  88. " Switch to rename for LSP to do add leader
  89. ""nnoremap <F4> :SearchTasks *<CR>
  90. nnoremap <C-h> <C-w>h
  91. nnoremap <C-j> <C-w>j
  92. nnoremap <C-k> <C-w>k
  93. nnoremap <C-l> <C-w>l
  94. " Remap terminal switch
  95. tnoremap <C-[> <C-\><C-n>
  96. tnoremap <C-c><Esc> <Esc>
  97. tnoremap <C-h> <C-\><C-n><C-w>h
  98. tnoremap <C-j> <C-\><C-n><C-w>j
  99. tnoremap <C-k> <C-\><C-n><C-w>k
  100. tnoremap <C-l> <C-\><C-n><C-w>l
  101. " TAB in general mode will mov to text buffer
  102. nnoremap <TAB> :bnext<CR>
  103. " SHIFT-TAB will go back
  104. nnoremap <S-TAB> :bprevious<CR>
  105. " Map leader switch to whatever you want
  106. let mapleader = ","