From 5d4d27c53cbc29ba8efb8fa5e88b5733b4e7796d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Fri, 15 Oct 2021 07:46:36 +0200 Subject: [PATCH] Make vim default on termux (instead of nvim) --- symlinks/config/fish/config.fish | 17 ++++-- symlinks/vim/after/plugin/coc.vim | 89 ------------------------------- symlinks/vim/plugin/coc.vim | 89 ------------------------------- symlinks/vim/plugins.vim | 26 +-------- 4 files changed, 15 insertions(+), 206 deletions(-) delete mode 100644 symlinks/vim/after/plugin/coc.vim delete mode 100644 symlinks/vim/plugin/coc.vim diff --git a/symlinks/config/fish/config.fish b/symlinks/config/fish/config.fish index a4f5ed3..4a797be 100644 --- a/symlinks/config/fish/config.fish +++ b/symlinks/config/fish/config.fish @@ -5,12 +5,21 @@ set -gx PROJECT_PATHS ~/Projects/*/* ~/Projects/Personal/Mixed\ Technology/Pract set -gx ASDF_PYTHON_DEFAULT_PACKAGES_FILE ~/.config/asdf/.python-default-packages set -gx FZF_DEFAULT_COMMAND 'rg --files' -alias vi "nvim" -alias vim "nvim" -alias vimdiff "nvim -d" +if which termux-info &> /dev/null + alias nvim "vim" + alias vi "vim" + alias vimdiff "vim -d" +else + alias vi "nvim" + alias vim "nvim" + alias vimdiff "nvim -d" +end alias cat "bat" -export MANPAGER="sh -c 'col -bx | bat -l man -p'" +if which termux-info &> /dev/null +else + export MANPAGER="sh -c 'col -bx | bat -l man -p'" +end abbr -a batdiff "git diff --name-only --diff-filter=d | xargs bat --diff" diff --git a/symlinks/vim/after/plugin/coc.vim b/symlinks/vim/after/plugin/coc.vim deleted file mode 100644 index 87c8214..0000000 --- a/symlinks/vim/after/plugin/coc.vim +++ /dev/null @@ -1,89 +0,0 @@ -" Must have extensions! -let g:coc_global_extensions = ['coc-json', 'coc-clangd', 'coc-snippets', 'coc-elixir'] -let g:coc_config_home = $HOME.'/.config/coc' - -" ----------------------------------------------------------------------------- -" - coc-snippets config - -" ----------------------------------------------------------------------------- -" Use for trigger snippet expand. -imap (coc-snippets-expand) - -" Use for select text for visual placeholder of snippet. -vmap (coc-snippets-select) - -" Use for both expand and jump (make expand higher priority.) -imap (coc-snippets-expand-jump) - -" Use x for convert visual selected code to snippet -xmap x (coc-convert-snippet) - -" Use tab for expansion -inoremap - \ pumvisible() ? coc#_select_confirm() : - \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : - \ check_back_space() ? "\" : - \ coc#refresh() - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -let g:coc_snippet_next = '' - -" ----------------------------------------------------------------------------- -" - Coc general LSP config - -" ----------------------------------------------------------------------------- - -" GoTo code navigation. -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -" Use K to show documentation in preview window. -nnoremap K :call show_documentation() - -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif -endfunction - -" Symbol renaming. -nmap rn (coc-rename) - -" Formatting selected code. -xmap f (coc-format-selected) -nmap f (coc-format-selected) - -" Applying codeAction to the selected region. -" Example: `aap` for current paragraph -xmap a (coc-codeaction-selected) -nmap a (coc-codeaction-selected) -" -" Remap keys for applying codeAction to the current buffer. -nmap ac (coc-codeaction) -nmap (coc-codeaction) -" Apply AutoFix to problem on the current line. -nmap qf (coc-fix-current) - -" Map function and class text objects -" NOTE: Requires 'textDocument.documentSymbol' support from the language server. -xmap if (coc-funcobj-i) -omap if (coc-funcobj-i) -xmap af (coc-funcobj-a) -omap af (coc-funcobj-a) -xmap ic (coc-classobj-i) -omap ic (coc-classobj-i) -xmap ac (coc-classobj-a) -omap ac (coc-classobj-a) - -" Use CTRL-S for selections ranges. -" Requires 'textDocument/selectionRange' support of language server. -nmap (coc-range-select) -xmap (coc-range-select) diff --git a/symlinks/vim/plugin/coc.vim b/symlinks/vim/plugin/coc.vim deleted file mode 100644 index 87c8214..0000000 --- a/symlinks/vim/plugin/coc.vim +++ /dev/null @@ -1,89 +0,0 @@ -" Must have extensions! -let g:coc_global_extensions = ['coc-json', 'coc-clangd', 'coc-snippets', 'coc-elixir'] -let g:coc_config_home = $HOME.'/.config/coc' - -" ----------------------------------------------------------------------------- -" - coc-snippets config - -" ----------------------------------------------------------------------------- -" Use for trigger snippet expand. -imap (coc-snippets-expand) - -" Use for select text for visual placeholder of snippet. -vmap (coc-snippets-select) - -" Use for both expand and jump (make expand higher priority.) -imap (coc-snippets-expand-jump) - -" Use x for convert visual selected code to snippet -xmap x (coc-convert-snippet) - -" Use tab for expansion -inoremap - \ pumvisible() ? coc#_select_confirm() : - \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : - \ check_back_space() ? "\" : - \ coc#refresh() - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -let g:coc_snippet_next = '' - -" ----------------------------------------------------------------------------- -" - Coc general LSP config - -" ----------------------------------------------------------------------------- - -" GoTo code navigation. -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -" Use K to show documentation in preview window. -nnoremap K :call show_documentation() - -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif -endfunction - -" Symbol renaming. -nmap rn (coc-rename) - -" Formatting selected code. -xmap f (coc-format-selected) -nmap f (coc-format-selected) - -" Applying codeAction to the selected region. -" Example: `aap` for current paragraph -xmap a (coc-codeaction-selected) -nmap a (coc-codeaction-selected) -" -" Remap keys for applying codeAction to the current buffer. -nmap ac (coc-codeaction) -nmap (coc-codeaction) -" Apply AutoFix to problem on the current line. -nmap qf (coc-fix-current) - -" Map function and class text objects -" NOTE: Requires 'textDocument.documentSymbol' support from the language server. -xmap if (coc-funcobj-i) -omap if (coc-funcobj-i) -xmap af (coc-funcobj-a) -omap af (coc-funcobj-a) -xmap ic (coc-classobj-i) -omap ic (coc-classobj-i) -xmap ac (coc-classobj-a) -omap ac (coc-classobj-a) - -" Use CTRL-S for selections ranges. -" Requires 'textDocument/selectionRange' support of language server. -nmap (coc-range-select) -xmap (coc-range-select) diff --git a/symlinks/vim/plugins.vim b/symlinks/vim/plugins.vim index adcd783..56f083b 100644 --- a/symlinks/vim/plugins.vim +++ b/symlinks/vim/plugins.vim @@ -33,36 +33,20 @@ endif Plug 'tpope/vim-sensible' Plug 'tpope/vim-endwise' Plug 'tpope/vim-surround' -Plug 'tpope/vim-fugitive' Plug 'tpope/vim-vinegar' -Plug 'tpope/vim-obsession' -Plug 'airblade/vim-gitgutter' -Plug 'godlygeek/tabular' -Plug 'Shougo/vimproc.vim', { 'do' : 'make' } -Plug 'vim-scripts/utl.vim' -Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' } -Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } -Plug 'junegunn/fzf.vim' Plug 'mhinz/vim-grepper' -Plug 'direnv/direnv.vim' Plug 'flazz/vim-colorschemes' Plug 'tpope/vim-speeddating' " ----------------------------------------------------------------------------- " - Autocompletion - " ----------------------------------------------------------------------------- -if !exists('g:loaded_node_provider') || g:loaded_node_provider != 0 - Plug 'neoclide/coc.nvim', {'branch': 'release'} -endif Plug 'ervandew/supertab' " ----------------------------------------------------------------------------- " - Tools - " ----------------------------------------------------------------------------- Plug 'tpope/vim-dispatch' -Plug 'radenling/vim-dispatch-neovim' -Plug 'vim-test/vim-test' -Plug 'dense-analysis/ale' Plug 'tpope/vim-projectionist' " ----------------------------------------------------------------------------- @@ -77,19 +61,13 @@ Plug 'tpope/vim-sleuth' " ----------------------------------------------------------------------------- " - Snippets - " ----------------------------------------------------------------------------- -if !exists('g:loaded_python3_provider') || g:loaded_python3_provider != 0 - Plug 'SirVer/ultisnips' - Plug 'honza/vim-snippets' -endif +Plug 'SirVer/ultisnips' +Plug 'honza/vim-snippets' " ----------------------------------------------------------------------------- " - Language support - " ----------------------------------------------------------------------------- Plug 'sheerun/vim-polyglot' -Plug 'c-brenn/phoenix.vim' -Plug 'tpope/vim-rails' -Plug 'tpope/vim-salve' -Plug 'tpope/vim-fireplace' Plug 'vimwiki/vimwiki' Plug 'esensar/vimwiki-reviews' Plug 'ledger/vim-ledger'