diff options
author | garhve <git@garhve.com> | 2024-09-16 11:47:28 +0800 |
---|---|---|
committer | garhve <git@garhve.com> | 2024-09-16 11:47:28 +0800 |
commit | bcfda983efdd527f75de54c35f5366f23e774233 (patch) | |
tree | 13df9f98cd06f78dbfa666b0e0e834346c76c247 /.config/vim/vimrc |
initialize
Diffstat (limited to '.config/vim/vimrc')
-rwxr-xr-x | .config/vim/vimrc | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/.config/vim/vimrc b/.config/vim/vimrc new file mode 100755 index 0000000..5ef184b --- /dev/null +++ b/.config/vim/vimrc @@ -0,0 +1,137 @@ +" Disable compatibility with vi which can cause unexpected issues. +set nocompatible + +" Enable type file detection. Vim will be able to try to detect the type of file in use. +filetype on + +" Enable plugins and load plugin for the detected file type. +filetype plugin on + +" Load an indent file for the detected file type. +filetype indent on + +" Turn syntax highlighting on. +syntax on + +" Highlight cursor line underneath the cursor horizontally. +set cursorline + +" Add numbers to each line on the left-hand side. +set number + +" Use spaces instead of tabs +set expandtab + +" Be smart when using tabs ;) +set smarttab + +" Set shift width to 4 spaces. +set shiftwidth=4 + +" Set tab width to 4 columns. +set tabstop=4 + +" Do not save backup files. +set nobackup + +" Do not wrap lines. Allow long lines to extend as far as the line goes. +set nowrap + +" Do not let cursor scroll below or above N number of lines when scrolling. +set scrolloff=10 + +" While searching though a file incrementally highlight matching characters as you type. +set incsearch + +" Ignore capital letters during search. +set ignorecase + +" Override the ignorecase option if searching for capital letters. This will allow you to search specifically for capital letters. +set smartcase + +" Show partial command you type in the last line of the screen. +set showcmd + +" Show the mode you are on the last line. +set showmode + +" Show matching words during a search. +set showmatch + +" Use highlighting when doing a search. +set hlsearch + +" Set the commands to save in history default number is 20. +set history=1000 + +" This is for vim-polyglot +set nocompatible + +" lightline configuration +set laststatus=2 +let g:lightline = { + \ 'colorscheme': 'nord', + \ } +set noshowmode + +" Enable wild menu +set wildmenu +set wildmode=list:longest,full + +" Remember fold info +augroup remember_folds + autocmd! + autocmd BufWinLeave,BufLeave,BufWritePost,BufHidden,QuitPre ?* nested silent! mkview! + autocmd BufWinEnter * silent! loadview +augroup END + +autocmd BufNew,BufRead *.asm set ft=nasm +au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown + +set runtimepath+=~/.local/share/vim,~/.local/share/vim/after +set viminfo+=n~/.local/share/vim/viminfo + +" Return to last edit position when opening files (You want this!) +au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif + +" PLUGINS ---------------------------------------------------------------- {{{ +call plug#begin('~/.local/share/vim/plugged') + + Plug 'preservim/nerdtree' + Plug 'nordtheme/vim' + Plug 'arcticicestudio/nord-vim' + Plug 'itchyny/lightline.vim' + Plug 'tibabit/vim-templates' + Plug 'godlygeek/tabular' + Plug 'preservim/vim-markdown' + +call plug#end() + +" Set color scheme to Nord +" if (has("termguicolors")) +" set termguicolors +" endif +colorscheme nord +augroup nord-overrides + autocmd! + autocmd ColorScheme nord highlight MatchParen ctermbg=6 ctermfg=0 guibg=#88C0D0 guifg=#2E3440 +augroup END +" }}} + +" MAPPINGS --------------------------------------------------------------- {{{ +" Mappings code goes here. +" }}} + +" VIMSCRIPT -------------------------------------------------------------- {{{ +" This will enable code folding. +" Use the marker method of folding. + augroup filetype_vim + autocmd! + autocmd FileType vim setlocal foldmethod=marker + augroup END +" More Vimscripts code goes here. +" }}} + +" STATUS LINE ------------------------------------------------------------ {{{ +" Status bar code goes here. +" }}} |