My dotfiles
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

134 řádky
3.4 KiB

  1. call plug#begin('~/.vim/plugged')
  2. "{{ The Basics }}
  3. Plug 'joshdick/onedark.vim' " Colors
  4. Plug 'itchyny/lightline.vim' " Lightline statusbar
  5. "{{ File management }}
  6. Plug 'scrooloose/nerdtree' " Nerdtree
  7. Plug 'tiagofumo/vim-nerdtree-syntax-highlight' " Highlighting Nerdtree
  8. Plug 'ryanoasis/vim-devicons' " Icons for Nerdtree
  9. "{{ Syntax Highlighting and Colors }}
  10. Plug 'ap/vim-css-color' " Color previews for CSS
  11. "{{ Junegunn Choi Plugins }}
  12. Plug 'junegunn/limelight.vim' " Hyperfocus on a range
  13. Plug 'junegunn/fzf.vim'
  14. call plug#end()
  15. " colorscheme
  16. syntax on
  17. " brackets
  18. inoremap " ""<left>
  19. inoremap ' ''<left>
  20. inoremap ( ()<left>
  21. inoremap [ []<left>
  22. inoremap { {}<left>
  23. inoremap {<CR> {<CR>}<ESC>O
  24. inoremap {;<CR> {<CR>};<ESC>O
  25. filetype plugin on
  26. let g:instant_markdown_browser = "firefox --new-window"
  27. " Make Vim more useful
  28. set nocompatible
  29. " Long lines as one line
  30. set nowrap
  31. " Ruler
  32. set ruler
  33. " Horizontal splits will automatically be below
  34. set splitbelow
  35. " Vertical splits will automatically be to the right
  36. set splitright
  37. " Indent
  38. set smartindent
  39. set autoindent
  40. set cursorline
  41. " Use the OS clipboard by default (on versions compiled with `+clipboard`)
  42. set clipboard+=unnamedplus
  43. " Enhance command-line completion
  44. set wildmenu
  45. " Disables automatic commenting on newline:
  46. autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
  47. " Allow cursor keys in insert mode
  48. " Allow backspace in insert mode
  49. set backspace=indent,eol,start
  50. " Optimize for fast terminal connections
  51. set ttyfast
  52. " Add the g flag to search/replace by default
  53. set gdefault
  54. " Use UTF-8 without BOM
  55. set encoding=utf-8
  56. " Change mapleader
  57. let mapleader=","
  58. " Don’t add empty newlines at the end of files
  59. set binary
  60. set noeol
  61. " 256 colors
  62. set t_Co=256
  63. " Respect modeline in files
  64. set modeline
  65. set modelines=4
  66. " Enable per-directory .vimrc files and disable unsafe commands in them
  67. set exrc
  68. set secure
  69. " Enable line numbers
  70. set number
  71. " Make tabs as wide as two spaces
  72. set tabstop=4
  73. set shiftwidth=4
  74. set smarttab
  75. set expandtab
  76. " Highlight searches
  77. set hlsearch
  78. " Ignore case of searches
  79. set ignorecase
  80. " Highlight dynamically as pattern is typed
  81. set incsearch
  82. " Always show status line
  83. set laststatus=2
  84. " Enable mouse in all modes
  85. set mouse=a
  86. " Disable error bells
  87. set noerrorbells
  88. " Don’t reset cursor to start of line when moving around.
  89. set nostartofline
  90. " Show the cursor position
  91. set ruler
  92. " Don’t show the intro message when starting Vim
  93. set shortmess=atI
  94. " Show the current mode
  95. set showmode
  96. " Show the filename in the window titlebar
  97. set title
  98. " Show the (partial) command as it’s being typed
  99. set showcmd
  100. " Use relative line numbers
  101. if exists("&relativenumber")
  102. set relativenumber
  103. au BufReadPost * set relativenumber
  104. endif
  105. " Start scrolling three lines before the horizontal window border
  106. set scrolloff=3
  107. " Better tabbing
  108. vnoremap < <gv
  109. vnoremap > >gv
  110. " Better window navigation
  111. nnoremap <C-h> <C-w>h
  112. nnoremap <C-j> <C-w>j
  113. nnoremap <C-k> <C-w>k
  114. nnoremap <C-l> <C-w>l
  115. map <Leader>c :w! \| !make <CR>
  116. map <Leader>r <c-w>v <c-w>l :terminal ./run.sh <c-r>% <CR>a
  117. map <Leader>t :!st&<CR><CR>
  118. map <Leader>o :FZF<CR>
  119. " Insert mode completion
  120. imap <c-x><c-k> <plug>(fzf-complete-word)
  121. imap <c-x><c-f> <plug>(fzf-complete-path)
  122. imap <c-x><c-l> <plug>(fzf-complete-line)
  123. vnoremap <C-c> "+y