coc auto formatting updates, airline theme, formatting

This commit is contained in:
Andrejus
2020-11-09 18:21:18 +00:00
parent 75b5a04b97
commit 5f6eec0996
9 changed files with 145 additions and 123 deletions

View File

@@ -1,4 +1,4 @@
from ubuntu:bionic as install FROM ubuntu:bionic as install
# Install sudo and make, git since built-in is skipped # Install sudo and make, git since built-in is skipped
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

View File

@@ -2,8 +2,8 @@
Collection of experimental dotfiles and supporting install scripts. Collection of experimental dotfiles and supporting install scripts.
Tested on and compatible with: Tested on and compatible with:
* Ubuntu 18.04
* Ubuntu 20.04 - Ubuntu 20.04
## Install ## Install
@@ -13,17 +13,19 @@ Tested on and compatible with:
Shell: 🐟 fish (+ fisher) Shell: 🐟 fish (+ fisher)
Editor: nvim (+ vim-plug) Editor: neovim (+ vim-plug)
Tools: Tools:
* aws
* docker (+ docker-compose) - aws, gcloud, firebase
* firebase - docker (+ docker-compose)
* terraform - kubectl
* screenfetch - terraform
- screenfetch
Languages: Languages:
* java
* js (nvm, node yarn, nvm) - java
* python (+ poetry, pyenv) - js (nvm, node, yarn)
* ruby - python (pyenv, poetry)
- ruby

View File

@@ -49,7 +49,7 @@ set updatetime=100
set timeoutlen=300 set timeoutlen=300
" Don't pass messages to |ins-completion-menu|. " Don't pass messages to |ins-completion-menu|.
set shortmess+=c set shortmess=atT
" Always show the signcolumn, otherwise it would shift the text each time " Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved. " diagnostics appear/become resolved.

View File

@@ -1,8 +1,27 @@
{ {
"coc.preferences.formatOnSaveFiletypes": [""], "coc.preferences.formatOnSaveFiletypes": [
"css",
"dockerfile",
"html",
"javascript",
"javascriptreact",
"json",
"make",
"markdown",
"perl",
"python",
"sh",
"svg",
"toml",
"typescript",
"typescriptreact",
"vim",
"xml",
"yaml"
],
"coc.preferences.extensionUpdateCheck": "daily", "coc.preferences.extensionUpdateCheck": "daily",
"list.source.files.args": ["--hidden" , "--files"], "list.source.files.args": ["--hidden", "--files"],
"suggest.echodocSupport": true, "suggest.echodocSupport": true,
@@ -43,17 +62,12 @@
"K": ["toggleSelection", "nodePrev"], "K": ["toggleSelection", "nodePrev"],
"gl": "expandRecursive", "gl": "expandRecursive",
"gh": "collapseRecursive", "gh": "collapseRecursive",
"<2-LeftMouse>": [
"expandable?",
["expanded?", "collapse", "expand"],
"open"
],
"o": ["expanded?", "collapse", "expand"], "o": ["expanded?", "collapse", "expand"],
"<cr>": ["expandable?", "cd", "open"], "<cr>": ["expandable?", "cd", "open"],
"e": "open", "e": "open",
"s": "open:split", "s": "open:split",
"S": "open:split:plain", "v": "open:vsplit",
"E": "open:vsplit",
"t": "open:tab", "t": "open:tab",
"<bs>": "gotoParent", "<bs>": "gotoParent",
"gp": "preview:labeling", "gp": "preview:labeling",

View File

@@ -87,10 +87,13 @@ nmap <silent> <leader>E :CocCommand explorer --reveal expand('<sfile>')<cr>
" <l>j - Jump to implementation of current symbol " <l>j - Jump to implementation of current symbol
" <l>s - Fuzzy search current project symbols " <l>s - Fuzzy search current project symbols
" <l>n - Symbol renaming " <l>n - Symbol renaming
" <l>k - Symbol renaming
nmap <silent> <C-n> <Plug>(coc-diagnostic-prev) nmap <silent> <C-n> <Plug>(coc-diagnostic-prev)
nmap <silent> <C-p> <Plug>(coc-diagnostic-next) nmap <silent> <C-p> <Plug>(coc-diagnostic-next)
" broken d
nmap <silent> <leader>d <Plug>(coc-definition) nmap <silent> <leader>d <Plug>(coc-definition)
nmap <silent> <leader>r <Plug>(coc-references) nmap <silent> <leader>r <Plug>(coc-references)
" broken j
nmap <silent> <leader>j <Plug>(coc-implementation) nmap <silent> <leader>j <Plug>(coc-implementation)
nmap <silent> <leader>s :<C-u>CocList -I -N --top symbols<cr> nmap <silent> <leader>s :<C-u>CocList -I -N --top symbols<cr>
nmap <silent> <leader>n <Plug>(coc-rename) nmap <silent> <leader>n <Plug>(coc-rename)
@@ -103,25 +106,6 @@ nnoremap <leader>h :%s///<left><left>
nnoremap <silent> <leader>/ :nohlsearch<cr> nnoremap <silent> <leader>/ :nohlsearch<cr>
" use <tab> for trigger completion and navigate to next complete item
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" Use K to show documentation in preview window. " Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<cr> nnoremap <silent> K :call <SID>show_documentation()<cr>
@@ -145,5 +129,3 @@ augroup mygroup
" Update signature help on jump placeholder. " Update signature help on jump placeholder.
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end augroup end

View File

@@ -17,7 +17,11 @@ Plug 'ryanoasis/vim-devicons'
" status line " status line
Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" {{{ " {{{
" Theme
let g:airline_theme = 'base16_seti'
" Enable extensions " Enable extensions
let g:airline_extensions = ['branch', 'coc', 'hunks'] let g:airline_extensions = ['branch', 'coc', 'hunks']
@@ -124,24 +128,32 @@ Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
" {{{ " {{{
let g:coc_global_extensions = [ let g:coc_global_extensions = [
\ 'coc-actions', \ 'coc-actions',
\ 'coc-clangd',
\ 'coc-css', \ 'coc-css',
\ 'coc-docker',
\ 'coc-emmet', \ 'coc-emmet',
\ 'coc-emoji', \ 'coc-emoji',
\ 'coc-eslint', \ 'coc-eslint',
\ 'coc-explorer', \ 'coc-explorer',
\ 'coc-fish',
\ 'coc-fzf-preview', \ 'coc-fzf-preview',
\ 'coc-git', \ 'coc-git',
\ 'coc-go',
\ 'coc-groovy',
\ 'coc-highlight', \ 'coc-highlight',
\ 'coc-html', \ 'coc-html',
\ 'coc-json', \ 'coc-json',
\ 'coc-lists', \ 'coc-lists',
\ 'coc-marketplace', \ 'coc-marketplace',
\ 'coc-perl',
\ 'coc-prettier', \ 'coc-prettier',
\ 'coc-python', \ 'coc-python',
\ 'coc-rust-analyzer',
\ 'coc-sh', \ 'coc-sh',
\ 'coc-snippets', \ 'coc-snippets',
\ 'coc-svg', \ 'coc-svg',
\ 'coc-tabnine', \ 'coc-tabnine',
\ 'coc-toml',
\ 'coc-tsserver', \ 'coc-tsserver',
\ 'coc-vimlsp', \ 'coc-vimlsp',
\ 'coc-xml', \ 'coc-xml',

View File

@@ -61,10 +61,11 @@ export VISUAL="nvim"
# fzf # fzf
export FZF_DEFAULT_OPTS="--reverse --margin=1,5%" export FZF_DEFAULT_OPTS="--reverse --margin=1,5%"
export FZF_DEFAULT_COMMAND='rg --files --smart-case --hidden --follow --no-ignore-vcs' export FZF_DEFAULT_COMMAND='fdfind --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_COMPLETION_TRIGGER='**' export FZF_COMPLETION_TRIGGER='**'
# do not use fishlogin # do not use fishlogin for subshells
export SHELL=/bin/sh export SHELL=/bin/sh
# _ _ _ ____ # _ _ _ ____
@@ -80,3 +81,5 @@ alias vi='vim'
alias bat='batcat' alias bat='batcat'
alias cat='bat' alias cat='bat'
alias j="z"

View File

@@ -1,6 +1,7 @@
apt-transport-https apt-transport-https
bat bat
curl curl
fdfind
git git
gnupg2 gnupg2
jq jq

View File

@@ -4,7 +4,7 @@
# #
from distutils.spawn import find_executable from distutils.spawn import find_executable
from typing import List from typing import List
from subprocess import run, CalledProcessError from subprocess import run
import pytest import pytest
@@ -26,7 +26,7 @@ def in_shell_path(shell: str, binary: str) -> bool:
try: try:
result = run(command, shell=True) result = run(command, shell=True)
return (result.returncode == 0) return (result.returncode == 0)
except: except Exception:
return False return False
@@ -49,7 +49,9 @@ binaries: List[str] = [
"nvim", "nvim",
"firebase", "firebase",
"aws", "aws",
"gcloud",
"terraform", "terraform",
"kubectl",
"docker", "docker",
"docker-compose", "docker-compose",
"screenfetch", "screenfetch",
@@ -65,13 +67,19 @@ binaries: List[str] = [
"node", "node",
"npm", "npm",
"yarn", "yarn",
"elm", # "elm",
# language: java
"java",
# langauge: ruby
"ruby"
] ]
# ---------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Tests # Tests
# ---------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
@pytest.mark.parametrize("shell", shells) @pytest.mark.parametrize("shell", shells)
def test_shells(shell: str): def test_shells(shell: str):
""" Assert all shells we expect are in PATH. """ """ Assert all shells we expect are in PATH. """