diff --git a/programs/nvim/ftdetect/javascript.vim b/programs/nvim/ftdetect/javascript.vim deleted file mode 100644 index 64e78a8..0000000 --- a/programs/nvim/ftdetect/javascript.vim +++ /dev/null @@ -1 +0,0 @@ -au BufNewFile,BufRead *.mjs setfiletype javascript diff --git a/programs/nvim/ftdetect/typescript.vim b/programs/nvim/ftdetect/typescript.vim deleted file mode 100644 index d6856b1..0000000 --- a/programs/nvim/ftdetect/typescript.vim +++ /dev/null @@ -1 +0,0 @@ -au BufNewFile,BufRead *.mts setfiletype typescript diff --git a/programs/nvim/init.vim b/programs/nvim/init.vim deleted file mode 100644 index 3414f8f..0000000 --- a/programs/nvim/init.vim +++ /dev/null @@ -1,154 +0,0 @@ -" Basic settings {{{ -let g:mapleader = ',' -let g:maplocalleader = '-' - -syntax enable -filetype plugin indent on -set clipboard+=unnamedplus -set encoding=utf-8 -set autoindent -set smartindent -set tabstop=2 -set shiftwidth=2 -set expandtab -set number -set signcolumn=yes -" TODO: use difference color column by filetypes -set colorcolumn=80,100,120 -set hidden -set nobackup -set nowritebackup -set updatetime=300 -set shortmess+=c -set nopaste -set foldcolumn=0 -" }}} - -" Mappings {{{ -nnoremap ev :split $MYVIMRC -nnoremap sv :source $MYVIMRC -" }}} - -cabbrev bsp belowright split -cabbrev rvsp belowright vsplit - -" Plugins {{{ -call plug#begin() - Plug 'junegunn/seoul256.vim' " theme - Plug 'Yggdroot/indentLine' " tab and space indentation - Plug 'mg979/vim-visual-multi', {'branch': 'master'} " multi cursors - Plug 'preservim/nerdtree' " file tree - Plug 'Xuyuanp/nerdtree-git-plugin' - Plug 'airblade/vim-gitgutter' " git gutter - - Plug 'prabirshrestha/vim-lsp' " lsp for many langs - Plug 'prabirshrestha/asyncomplete.vim' " autocomplete - Plug 'prabirshrestha/asyncomplete-lsp.vim' - Plug 'mattn/vim-lsp-settings' " settings for lsp plugin - - Plug 'sbdchd/neoformat' " format langs via official tools - Plug 'easymotion/vim-easymotion' " fast navigation - Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " fuzzy find files - Plug 'junegunn/fzf.vim' " fzf integration - Plug 'dyng/ctrlsf.vim' " async searching - Plug 'christoomey/vim-tmux-navigator' " navigation inside tmux - Plug 'editorconfig/editorconfig-vim' " editorconfig - Plug 'cespare/vim-toml', { 'branch': 'main' } " toml lang - Plug 'rust-lang/rust.vim' " rust lang - Plug 'jparise/vim-graphql' " graphql lang with gql tag - Plug 'lifepillar/pgsql.vim' " postgresql lang support - Plug 'LnL7/vim-nix' " nix lang -call plug#end() -" }}} - -" Plugin: GitGutter {{{ -let g:gitgutter_sign_priority = 1 -let g:gitgutter_set_sign_backgrounds = 0 -let g:gitgutter_map_keys = 0 - -nnoremap ghl :GitGutterLineHighlightsToggle -nnoremap ghp :GitGutterPreviewHunk -" }}} - -let g:sql_type_default = 'pgsql' - -" Plugin: NeoFormat {{{ -let g:neoformat_try_node_exe = 1 -let g:neoformat_only_msg_on_error = 1 -let g:neoformat_enabled_markdown = ["denofmt"] -aug fmt - au! - au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry -aug END -" }}} - -" Plugin: NerdTree {{{ -let g:NERDTreeDirArrowExpandable = '▸' -let g:NERDTreeDirArrowCollapsible = '▾' -let g:NERDTreeMinimalUI = 1 -let g:NERDTreeDirArrows = 1 -nnoremap nf :NERDTreeFocus -nnoremap nt :NERDTreeToggle -nnoremap nf :NERDTreeFind -" }}} - -" Plugin: NerdTreeGit {{{ -let g:NERDTreeGitStatusShowIgnored = 1 -let g:NERDTreeGitStatusIndicatorMapCustom = { - \ "Modified" : "ᵐ", - \ "Staged" : "ˢ", - \ "Untracked" : "ᵘ", - \ "Renamed" : "ʳ", - \ "Unmerged" : "ᶴ", - \ "Deleted" : "ˣ", - \ "Dirty" : "˜", - \ "Clean" : "ᵅ", - \ "Unknown" : "?" - \ } -" }}} - -" Plugin: LSP {{{ -let g:lsp_preview_max_width = 60 -let g:lsp_diagnostics_float_cursor = 1 -let g:lsp_settings_filetype_typescript = ['typescript-language-server', 'eslint-language-server', 'deno'] -let g:lsp_settings_filetype_typescriptreact = ['typescript-language-server', 'eslint-language-server'] - -if (executable('haskell-language-server-wrapper')) - echom "Haskell lsp installed" - au User lsp_setup call lsp#register_server({ - \ 'name': 'haskell-language-server-wrapper', - \ 'cmd': {server_info->['haskell-language-server-wrapper', 'lsp']}, - \ 'whitelist': ['haskell'], - \ }) -endif - -function! s:on_lsp_buffer_enabled() abort - setlocal omnifunc=lsp#complete - if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif - nmap gd (lsp-definition) - nmap gr (lsp-references) - nmap gi (lsp-implementation) - "nmap gt (lsp-type-definition) - nmap n (lsp-rename) - nmap a (lsp-code-action) - nmap h (lsp-signature-help) - nmap [g (lsp-previous-diagnostic) - nmap ]g (lsp-next-diagnostic) - nmap K (lsp-hover) - " refer to doc to add more commands -endfunction - -aug lsp_install - au! - " call s:on_lsp_buffer_enabled only for languages that has the server registered. - au User lsp_buffer_enabled call s:on_lsp_buffer_enabled() -aug END -" }}} - -" Theme {{{ -set background=light -colo seoul256-light -highlight ColorColumn ctermbg=254 -" uses for fzf preview -let $BAT_THEME = 'Monokai Extended Light' -" }}} diff --git a/programs/nvim/plugins/base-fold-opt.vim b/programs/nvim/plugins/base-fold-opt.vim deleted file mode 100644 index 30bcb89..0000000 --- a/programs/nvim/plugins/base-fold-opt.vim +++ /dev/null @@ -1,21 +0,0 @@ -aug config_fold - au! - au FileType * call ConfigFold() -aug END - -function! s:ConfigFold() - let l:ft = &g:filetype - - if l:ft ==# 'vim' - call SetlFold('marker', 0) - elseif l:ft ==# 'markdown' - return - else - call SetlFold('syntax', 99) - endif -endfunction - -function! s:SetlFold(method, lvl) - let &foldmethod = a:method - let &foldlevel = a:lvl -endfunction