You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
7.3KB

  1. set background=dark " Dark theme for the colorscheme
  2. colorscheme hybrid " Colorscheme
  3. set ruler " Show the cursor position all the time
  4. set cursorline " Highlight current line
  5. set number relativenumber " Line numbers, current and relative
  6. set updatetime=100 " Shorten update time to 100ms instead of 4
  7. set listchars=tab:▸·,trail:-,nbsp:·
  8. set list " Display tabs and trailing spaces
  9. set linebreak " Break lines with wrap on word separators
  10. set breakindent " Indent the wrapped line
  11. set breakindentopt=shift:2,sbr " Indent by 2 and draw the break char
  12. set showbreak=↳
  13. highlight Normal ctermbg=NONE guibg=NONE " transparent background
  14. highlight EndOfBuffer ctermbg=NONE
  15. highlight List ctermbg=NONE ctermfg=darkred guibg=lightgray " Listchars highlight
  16. match List /\%xa0/
  17. 2match List / \+$/
  18. highlight DiffText ctermbg=104 ctermfg=220
  19. highlight LineNr ctermfg=darkgrey
  20. highlight Comment cterm=italic " Comments in italics
  21. highlight MatchParen ctermbg = 11 " Match parenthesis in bright yellow
  22. highlight Conceal ctermbg=NONE ctermfg=grey
  23. highlight Visual ctermbg=darkgrey
  24. highlight Pmenu ctermbg=darkgrey
  25. set showcmd " Show visual selection size
  26. set splitright " Vertical split to the right
  27. set fillchars=vert:⎢ " Vertical line for splits
  28. set laststatus=2 " Always display status bar
  29. set timeoutlen=300 " Set key timeout
  30. set hidden " Enable buffers to be hidden even if modified
  31. set fileencoding=utf-8 " Encoding
  32. scriptencoding utf-8
  33. set autochdir " Auto change directory to current file
  34. set undofile undodir=~/.config/nvim/undodir/ " Permanent undo
  35. set backup backupdir=~/.config/nvim/backupdir " Set backup folder
  36. set swapfile directory=~/.config/nvim/swap " Swapfile
  37. set updatecount=10 " Write to swap every 10 chars
  38. set foldmethod=syntax " Fold with syntax
  39. set foldlevelstart=99
  40. set completeopt=noinsert,menuone " Display a completion menu, don't insert anything till selected
  41. set wildmenu " Autocomplete in command mode
  42. set wildmode=list:longest,full " First show list of matches without replacing, then completion
  43. set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png,*.ico " Skip those filetypes and directories
  44. set wildignore+=*.mkv,*.mp4,*.avi
  45. set wildignore+=.cache/*,Private/*,Documents/*,Downloads/*,Jeux/*,node_modules/*,old_desktop/*,R/*
  46. set wildignorecase " Ignore case when searching for files
  47. set cpoptions+=$ " Display $ in change mode
  48. set backspace=indent,eol,start " Allow backspace to erase indent,eol, before start
  49. set history=50 " Keep 50 lines of command line history
  50. set gdefault " s///g by default
  51. set incsearch " Do incremental searching
  52. set hlsearch " Highlight searches
  53. set ignorecase smartcase " Smartcase
  54. set inccommand=nosplit " Preview replace
  55. highlight Search cterm=bold,underline ctermfg=NONE ctermbg=NONE " Search results in underlined bold
  56. set spelllang=en_us " Correct spelling in English by default
  57. set mouse=a " Enable mouse
  58. set autoindent " Indent like previous line
  59. set smartindent " Also indent in code blocks
  60. set scrolloff=10 " Vertical scroll offset
  61. set sidescroll=1 " Scroll horizontally one line at a time
  62. set sidescrolloff=1000 " Horizontal scroll offset (keep cursor in middle)
  63. set expandtab " Use spaces instead of tabs
  64. set tabstop=2 " Use 2 spaces for one tab
  65. set softtabstop=2 " Use 2 spaces for soft tabs
  66. set shiftwidth=2 " Shift by 2 spaces when indenting
  67. set formatoptions+=j " Delete comment character when joining comment lines
  68. set diffopt=filler,vertical,foldcolumn:0
  69. set clipboard^=unnamed,unnamedplus "default clipboard to X clipboard
  70. set diffopt=filler,vertical
  71. augroup Resource
  72. autocmd!
  73. autocmd! bufwritepost ~/.config/nvim/init.*
  74. \ source ~/.config/nvim/init.vim " Reload .vimrc after editing
  75. augroup END
  76. augroup templates
  77. autocmd!
  78. autocmd! BufNewFile *.md 0r ~/.config/nvim/templates/template.md
  79. autocmd! BufNewFile *.Rmd 0r ~/.config/nvim/templates/template.Rmd
  80. augroup END
  81. augroup ncm2start
  82. autocmd!
  83. autocmd! BufEnter * call ncm2#enable_for_buffer()
  84. augroup END