diff --git a/modules/editor.nix b/modules/editor.nix index bb418bed..e5591b73 100644 --- a/modules/editor.nix +++ b/modules/editor.nix @@ -6,6 +6,19 @@ extraConfig = '' set undofile set spell + set number + set clipboard=unnamedplus + + autocmd VimLeave * set guicursor=a:block-blinkon1 + + map + imap + map <2-MiddleMouse> + imap <2-MiddleMouse> + map <3-MiddleMouse> + imap <3-MiddleMouse> + map <4-MiddleMouse> + imap <4-MiddleMouse> ''; plugins = with pkgs.vimPlugins; [ { diff --git a/neovim/.config/nvim/init.vim b/neovim/.config/nvim/init.vim deleted file mode 100644 index 36e3252c..00000000 --- a/neovim/.config/nvim/init.vim +++ /dev/null @@ -1,16 +0,0 @@ -" New Start: A modern Arch workflow built with an emphasis on functionality. -" Copyright (C) 2017-2018 Donovan Glover - -set runtimepath^=~/.vim runtimepath+=~/.vim/after - -let &packpath = &runtimepath - -" Enable global clipboard support for all vim commands in neovim -" NOTE: It may be better to just add a keybind for "+(y), or just -" use that instead. -set clipboard=unnamedplus - -" Change cursor back to blink after exiting neovim -autocmd VimLeave * set guicursor=a:block-blinkon1 - -source ~/.vimrc diff --git a/neovim/README.md b/neovim/README.md deleted file mode 100644 index d13b9706..00000000 --- a/neovim/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# neovim - -[neovim][neovim] is a vim fork with modern defaults. - -## Use Cases - -neovim can be used to: - -- Simplify the process of learning vim, since it uses standard defaults - -You should not use neovim if: - -- You should use neovim. - -[neovim]: https://github.com/neovim/neovim diff --git a/vim/.vimrc b/vim/.vimrc index a3ad53ea..a794c5bf 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,14 +1,3 @@ -" New Start: A modern Arch workflow built with an emphasis on functionality. -" Copyright (C) 2017-2023 Donovan Glover - -let plugsys = glob('/usr/share/vim/vimfiles/autoload/plug.vim') -let plugusr = glob('~/.vim/autoload/plug.vim') - -if empty(plugsys) && empty(plugusr) - silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/0.10.0/plug.vim -endif - let g:ale_disable_lsp = 1 autocmd FileType javascript let g:ale_linters = { @@ -16,19 +5,12 @@ autocmd FileType javascript let g:ale_linters = { \} call plug#begin('~/.vim/plugged') - Plug 'dylanaraps/wal.vim' " Color scheme - Plug 'preservim/nerdtree' - Plug 'airblade/vim-gitgutter' " Git diff - Plug 'itchyny/lightline.vim' " Status line Plug 'dense-analysis/ale' " Syntax checker - Plug 'tpope/vim-fugitive' " Git wrapper - Plug 'junegunn/fzf.vim' " fzf wrapper Plug 'lunarWatcher/auto-pairs' " {Pair} completion Plug 'tpope/vim-endwise' " 'End' completion Plug 'reedes/vim-pencil' " Word wrap Plug 'junegunn/goyo.vim' " Distraction-free writing Plug 'jparise/vim-graphql' " GraphQL support - Plug 'ryanoasis/vim-devicons' Plug 'osyo-manga/vim-over' Plug 'maksimr/vim-jsbeautify' @@ -103,28 +85,10 @@ set smarttab " Always indent based on column number to align t set mouse=a " Enable mouse support in (a)ll modes set number " Show numbers by default -" Disable middle button click -map -imap -map <2-MiddleMouse> -imap <2-MiddleMouse> -map <3-MiddleMouse> -imap <3-MiddleMouse> -map <4-MiddleMouse> -imap <4-MiddleMouse> - " ========================== " ========= colors ========= " ========================== -" Set the color scheme to wal, or install plugins as needed. -try - colorscheme wal -catch /^Vim\%((\a\+)\)\=:E185/ - echo "wal was not found. Installing plugins...\n" | PlugInstall --sync - echo "Plugins installed! You can now use vim.\n" | qa -endtry - " Don't show the separator for vertical splits highlight vertsplit ctermfg=0 ctermbg=none @@ -139,50 +103,6 @@ highlight IncSearch ctermbg=255 ctermfg=240 autocmd BufNewFile,BufRead *.ecr setlocal syntax=html autocmd BufNewFile,BufRead *.slang setlocal filetype=slim -" ============================= -" ========= lightline ========= -" ============================= - -" Add the current branch to the status line -let g:lightline = { -\ 'active': { -\ 'left': [ -\ [ 'mode', 'paste' ], [ 'gitbranch' ], -\ ['readonly', 'filename', 'modified'] -\ ] -\ }, -\ 'component_function': { -\ 'gitbranch': 'fugitive#head' -\ } -\ } - -" Note that wal.vim's lightline theme uses some options that are incompatible -" with regular vim and are only supported by neovim. -" -" Wal Themes: Tomorrow, Tomorrow_Night, one, materia, material, nord -" Other Themes: wombat, solarized, powerline, jellybeans, Tomorrow_Night_Blue, -" Tomorrow_Night_Eighties, PaperColor, seoul256, landscape, -" darcula, molokai, OldHope, deus -if has('nvim') - let g:lightline.colorscheme = 'wal' -else - let g:lightline.colorscheme = 'Tomorrow_Night' -endif - -" Make background color of lightline match terminal -" https://github.com/itchyny/lightline.vim/issues/168 -autocmd VimEnter * call SetupLightlineColors() -function SetupLightlineColors() abort - " transparent background in statusbar - let l:palette = lightline#palette() - - let l:palette.normal.middle = [ [ 'NONE', 'NONE', 'NONE', 'NONE' ] ] - let l:palette.inactive.middle = l:palette.normal.middle - let l:palette.tabline.middle = l:palette.normal.middle - - call lightline#colorscheme() -endfunction - " ============================ " ========= keybinds ========= " ============================ @@ -225,23 +145,6 @@ nnoremap 4 :source ~/.vim/.session " Never worry about a directory not being created before saving autocmd BufWritePre,FileWritePre * silent! call mkdir(expand(':p:h'), 'p') -" ========================= -" ========= netrw ========= -" ========================= - -" Remove the banner -let g:netrw_banner = 0 - -" Use the tree list view -let g:netrw_liststyle = 3 - -" ======================= -" ========= ale ========= -" ======================= - -nmap (ale_previous_wrap) -nmap (ale_next_wrap) - " ========================== " ========= vimtex ========= " ========================== @@ -273,25 +176,3 @@ let g:vim_markdown_conceal = 0 let g:tex_conceal = "" let g:vim_markdown_math = 1 -" ============================ -" ========= nerdtree ========= -" ============================ - -let NERDTreeShowHidden=1 - -" Exit if NERDTree is the only window remaining in the only tab. -autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif - -let NERDTreeStatusline='%{exists("b:NERDTree")?fnamemodify(b:NERDTree.root.path.str(), ":~"):""}' - -" =========================== -" ========= fzf.vim ========= -" =========================== - -" Hide the status line showing "fzf" when using fzf.vim -" NOTE: You must add "showmode" if your setup depends on it -autocmd! FileType fzf -autocmd FileType fzf set laststatus=0 noshowmode noruler - \| autocmd BufLeave set laststatus=2 ruler - -hi Comment cterm=italic gui=italic