Migrated old vim/nvim config to nix

This commit is contained in:
Random936 2024-07-23 21:14:00 -07:00
parent 1e997d1061
commit c8a199b9fc
4 changed files with 45 additions and 72 deletions

View File

@ -1,4 +0,0 @@
:syntax on
:set tabstop=2
:set hlsearch
:set relativenumber

View File

@ -1,3 +0,0 @@
{
"diagnostic.checkCurrentLine": true
}

View File

@ -1,65 +0,0 @@
" Smart indent and and better tab length
set formatoptions-=cro
set tabstop=3 softtabstop=3
set shiftwidth=3
set expandtab
set smartindent
set nu
set relativenumber
set nohlsearch
set hidden
set incsearch
set scrolloff=8
set colorcolumn=80
set signcolumn=yes
" Remove arrow keys to train my fingers
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
" set <leader> to space
nnoremap <space> <nop>
let mapleader=" "
call plug#begin('~/.vim/plugged')
" Syntax highlighting and autocomplete for nvim
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" FZF for better file jumping.
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" Theme and Syntax Highlighting
Plug 'morhetz/gruvbox'
Plug 's3rvac/vim-syntax-yara'
call plug#end()
" Set colorscheme
let g:gruvbox_contrast_dark = 'hard'
" Transparent background with gruvbox theme
colorscheme gruvbox
set background=dark
hi Normal guibg=NONE ctermbg=NONE
" Yara syntax highlighting
autocmd BufNewFile,BufRead *.yar,*.yara setlocal filetype=yara
" FZF key bindings
nnoremap <leader>ff <cmd>Files<cr>
nnoremap <leader>fg <cmd>Rg<cr>
nnoremap <leader>fb <cmd>Buffers<cr>
" use <tab> for trigger completion and navigate to the next complete item
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()

View File

@ -10,7 +10,52 @@
};
plugins = with pkgs.vimPlugins; [
supertab
nvim-fzf
vim-airline
# COC packages.
coc-sh
coc-css
coc-html
coc-json
coc-yaml
coc-svelte
coc-clangd
coc-docker
coc-tsserver
coc-rust-analyzer
];
extraConfig = ''
" Better smart indenting.
set formatoptions-=cro
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set nu
set relativenumber
set nohlsearch
set hidden
set incsearch
set scrolloff=8
set colorcolumn=80
set signcolumn=yes
" Remove arrow keys to train my fingers
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
" FZF key bindings
nnoremap <leader>pf <cmd>Files<cr>
nnoremap <leader>pg <cmd>Rg<cr>
" Supertab start at top of completion list
let g:SuperTabContextDefaultCompletionType = "<c-n>"
'';
};
}