Last active
February 14, 2020 03:59
-
-
Save iliafrenkel/30d6c7cbb2372f84dfd545d5969fa156 to your computer and use it in GitHub Desktop.
My .vimrc configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Set compatibility to Vim only. | |
set nocompatible | |
" Helps force plug-ins to load correctly when it is turned back on below. | |
filetype off | |
" Disable swap files | |
set noswapfile | |
" Search down into subfolders | |
set path+=** | |
" Turn on syntax highlighting. | |
syntax on | |
"colorscheme default | |
" Neodark colour scheme configuration | |
" https://github.com/keitanakamura/neodark.vim | |
if (empty($TMUX)) | |
if (has("nvim")) | |
let $NVIM_TUI_ENABLE_TRUE_COLOR=1 | |
endif | |
if (has("termguicolors")) | |
set termguicolors | |
endif | |
endif | |
colorscheme neodark | |
" let g:neodark#background = '#202020' " set background colour | |
" Uncomment the line below to use your default terminal background | |
let g:neodark#terminal_transparent = 1 | |
" let g:neodark#use_256color = 1 | |
" let g:neodark#use_custom_terminal_theme = 1 | |
" For plug-ins to load correctly. | |
filetype plugin indent on | |
" Automatically wrap text that extends beyond the screen length. | |
set wrap | |
set textwidth=79 | |
set formatoptions=tcqrn1 | |
set expandtab | |
set noshiftround | |
set number | |
set linebreak | |
set softtabstop=4 | |
" Display 5 lines above/below the cursor when scrolling with a mouse. | |
set scrolloff=5 | |
" Fixes common backspace problems | |
set backspace=indent,eol,start | |
" Display options | |
set noshowmode | |
set noshowcmd | |
" Encoding | |
set encoding=utf-8 | |
" Highlight matching search patterns | |
set hlsearch | |
" Enable incremental search | |
set incsearch | |
" Include matching uppercase words with lowercase search term | |
set ignorecase | |
" Include only uppercase words with uppercase search term | |
set smartcase | |
" Use system clipboard | |
set clipboard+=unnamedplus | |
let mapleader="\<Space>" | |
" Make easy editing and sourcing vimrc | |
command! RefreshConfig source $MYVIMRC <bar> echo "Refreshed vimrc!" | |
" <Leader> ev for edit vimrc | |
:nnoremap <leader>ev :vsplit $MYVIMRC<cr> | |
" <Leader> sv for sourcing vimrc | |
:nnoremap <leader>sv :RefreshConfig<cr> | |
" Map 'H' and 'L' to move to the start/end of line | |
nnoremap H ^ | |
nnoremap L g_ | |
" Map 'jk' to <ESC> in insert mode to make it easier to go to normal mode | |
inoremap jk <ESC> | |
" Map <Ctrl>+n to open NERDTree | |
" (https://github.com/Xuyuanp/nerdtree-git-plugin) | |
nnoremap <C-n> :NERDTreeToggle<CR> | |
" Configuration for vim-airline plugin | |
let g:airline_powerline_fonts = 1 " Tell airline to use powerline font | |
set ttimeoutlen=10 " Remove pause when entering/leaving insert mode | |
" Set path for fzf plugin to work properly | |
set rtp+=~/.fzf | |
nnoremap <C-p> :Files<CR> | |
" Configuration for vimwiki plugin | |
let g:vimwiki_list = [{'path': '~/vimwiki/', 'syntax': 'markdown', 'ext': '.mkd'}] | |
# To fix Yaml frontmatter highlighting (eg. Hugo) add `markdown.vim` to `~/.vim/after/syntax/` | |
# with the following content: | |
# unlet b:current_syntax | |
# syntax include @Yaml syntax/yaml.vim | |
# syntax region yamlFrontmatter start=/\%^---$/ end=/^---$/ keepend contains=@Yaml | |
" A list of installed plugins. I am putting it here to have it all in one | |
" place. Plugins go to `~/.vim/pack/<whatever>/start/` | |
" | |
" 1. NERDTree - https://github.com/preservim/nerdtree | |
" A file system explorer. | |
" 2. vim-airline - https://github.com/vim-airline/vim-airline | |
" A lightweight status line. | |
" 3. fugitive - https://github.com/tpope/vim-fugitive | |
" Git wrapper for vim. | |
" 4. fzf.vim - https://github.com/junegunn/fzf.vim.git | |
" Fuzzy search for vim. | |
" 5. neodark.vim - https://github.com/keitanakamura/neodark.vim | |
" Neodark colour scheme. | |
" 6. vim-polyglot - https://github.com/sheerun/vim-polyglot | |
" A collection of language packs. | |
" 7. vim-go - https://github.com/fatih/vim-go | |
" Go language support for Vim. | |
" 8. vimwiki - https://github.com/vimwiki/vimwiki | |
" A personal wiki for Vim. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment