Make vim default on termux (instead of nvim)

pull/2/head
Ensar Sarajčić 2021-10-15 07:46:36 +02:00
parent 2c68186bd0
commit 5d4d27c53c
4 changed files with 15 additions and 206 deletions

View File

@ -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"

View File

@ -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 <C-l> for trigger snippet expand.
imap <C-l> <Plug>(coc-snippets-expand)
" Use <C-j> for select text for visual placeholder of snippet.
vmap <C-j> <Plug>(coc-snippets-select)
" Use <C-j> for both expand and jump (make expand higher priority.)
imap <C-j> <Plug>(coc-snippets-expand-jump)
" Use <leader>x for convert visual selected code to snippet
xmap <leader>x <Plug>(coc-convert-snippet)
" Use tab for expansion
inoremap <silent><expr> <TAB>
\ pumvisible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
" -----------------------------------------------------------------------------
" - Coc general LSP config -
" -----------------------------------------------------------------------------
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
"
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
nmap <M-CR> <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of language server.
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)

View File

@ -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 <C-l> for trigger snippet expand.
imap <C-l> <Plug>(coc-snippets-expand)
" Use <C-j> for select text for visual placeholder of snippet.
vmap <C-j> <Plug>(coc-snippets-select)
" Use <C-j> for both expand and jump (make expand higher priority.)
imap <C-j> <Plug>(coc-snippets-expand-jump)
" Use <leader>x for convert visual selected code to snippet
xmap <leader>x <Plug>(coc-convert-snippet)
" Use tab for expansion
inoremap <silent><expr> <TAB>
\ pumvisible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
" -----------------------------------------------------------------------------
" - Coc general LSP config -
" -----------------------------------------------------------------------------
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
"
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
nmap <M-CR> <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of language server.
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)

View File

@ -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'