Compare commits
No commits in common. "15f12275227727e5d6a086b3663c50fca841c057" and "83437bd724752d2fc5db1e1fb20e9d44cbf5ea03" have entirely different histories.
15f1227522
...
83437bd724
42
.bashrc
42
.bashrc
|
@ -3,31 +3,25 @@
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[[ $- != *i* ]] && return
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
. /etc/os-release
|
source /etc/os-release
|
||||||
|
|
||||||
# Editor & prompt configuration
|
# Editor & prompt configuration
|
||||||
[ -f "$HOME/.bashrc.d/editor" ] && . "$HOME/.bashrc.d/editor"
|
[ -f "$HOME/.bashrc.d/editor" ] && source "$HOME/.bashrc.d/editor"
|
||||||
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
|
[ -f "$HOME/.bashrc.d/prompt" ] && source "$HOME/.bashrc.d/prompt"
|
||||||
|
|
||||||
# Aliases {{{
|
# Aliases {{{
|
||||||
# Load aliases dynamically
|
# Load aliases dynamically
|
||||||
[ -f "$HOME/.bash_aliases/all" ] && . "$HOME/.bash_aliases/all"
|
[ -f "$HOME/.bash_aliases/all" ] && source "$HOME/.bash_aliases/all"
|
||||||
[ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && . "$HOME/.bash_aliases/hosts/$HOSTNAME"
|
[ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && source "$HOME/.bash_aliases/hosts/$HOSTNAME"
|
||||||
[ -f "$HOME/.bash_aliases/private" ] && . "$HOME/.bash_aliases/private"
|
[ -f "$HOME/.bash_aliases/private" ] && source "$HOME/.bash_aliases/private"
|
||||||
|
|
||||||
# Completions {{{
|
|
||||||
[ -d "$HOME/.bash_completions" ] && for file in "$HOME/.bash_completions"/*; do
|
|
||||||
[ -f "$file" ] && . "$file"
|
|
||||||
done
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
# Host-specific and private configurations
|
# Host-specific and private configurations
|
||||||
[ -f "$HOME/.bashrc.d/hosts/$HOSTNAME" ] && . "$HOME/.bashrc.d/hosts/$HOSTNAME"
|
[ -f "$HOME/.bashrc.d/hosts/$HOSTNAME" ] && source "$HOME/.bashrc.d/hosts/$HOSTNAME"
|
||||||
[ -f "$HOME/.bashrc.d/private" ] && . "$HOME/.bashrc.d/private"
|
[ -f "$HOME/.bashrc.d/private" ] && source "$HOME/.bashrc.d/private"
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Prompt {{{
|
# Prompt {{{
|
||||||
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
|
[ -f "$HOME/.bashrc.d/prompt" ] && source "$HOME/.bashrc.d/prompt"
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Path {{{
|
# Path {{{
|
||||||
|
@ -51,7 +45,7 @@ export PAGER=nvimpager
|
||||||
# Nvm
|
# Nvm
|
||||||
export PATH=~/.nvm/versions/node/v14.16.0/bin:$PATH
|
export PATH=~/.nvm/versions/node/v14.16.0/bin:$PATH
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[[ -s "$NVM_DIR/nvm.sh" ]] && . "$NVM_DIR/nvm.sh" --no-use
|
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" --no-use
|
||||||
|
|
||||||
# X11 {{{
|
# X11 {{{
|
||||||
export XDG_SESSION_TYPE=X11
|
export XDG_SESSION_TYPE=X11
|
||||||
|
@ -73,11 +67,11 @@ if [ -f "/usr/bin/fzf" ]; then
|
||||||
export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'"
|
export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'"
|
||||||
|
|
||||||
if [[ $ID == "raspbian" ]]; then
|
if [[ $ID == "raspbian" ]]; then
|
||||||
. /usr/share/doc/fzf/examples/completion.bash
|
source /usr/share/doc/fzf/examples/completion.bash
|
||||||
. /usr/share/doc/fzf/examples/key-bindings.bash
|
source /usr/share/doc/fzf/examples/key-bindings.bash
|
||||||
elif [[ $ID == "arch" ]]; then
|
elif [[ $ID == "arch" ]]; then
|
||||||
. /usr/share/fzf/completion.bash
|
source /usr/share/fzf/completion.bash
|
||||||
. /usr/share/fzf/key-bindings.bash
|
source /usr/share/fzf/key-bindings.bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_fzf_setup_completion path vim zathura xournalpp nvim mpv
|
_fzf_setup_completion path vim zathura xournalpp nvim mpv
|
||||||
|
@ -91,9 +85,9 @@ fi
|
||||||
export NVM_DIR="${XDG_CONFIG_HOME}/nvm"
|
export NVM_DIR="${XDG_CONFIG_HOME}/nvm"
|
||||||
# Pretty much what is in `/usr/share/nvm/init-nvm.sh` but we add the `--no-use`
|
# Pretty much what is in `/usr/share/nvm/init-nvm.sh` but we add the `--no-use`
|
||||||
# flag to `nvm.sh` to make it lazy
|
# flag to `nvm.sh` to make it lazy
|
||||||
. /usr/share/nvm/nvm.sh --no-use
|
source /usr/share/nvm/nvm.sh --no-use
|
||||||
. /usr/share/nvm/bash_completion
|
source /usr/share/nvm/bash_completion
|
||||||
. /usr/share/nvm/install-nvm-exec
|
source /usr/share/nvm/install-nvm-exec
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Go {{{
|
# Go {{{
|
||||||
|
@ -105,7 +99,7 @@ export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Conda {{{
|
# Conda {{{
|
||||||
[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && . /opt/miniconda3/etc/profile.d/conda.sh
|
[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && source /opt/miniconda3/etc/profile.d/conda.sh
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Zettelkasten {{{
|
# Zettelkasten {{{
|
||||||
|
|
|
@ -77,6 +77,3 @@
|
||||||
colorMoved = zebra
|
colorMoved = zebra
|
||||||
[commit]
|
[commit]
|
||||||
gpgsign = false
|
gpgsign = false
|
||||||
|
|
||||||
[interactive]
|
|
||||||
singleKey = true
|
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
if !exists("g:did_coc_loaded") | echo "`coc.nvim` not loaded (not configuring)" | finish | endif
|
||||||
|
|
||||||
|
let g:coc_global_extensions = [
|
||||||
|
\'coc-dictionary',
|
||||||
|
\'coc-syntax',
|
||||||
|
\'coc-eslint',
|
||||||
|
\'coc-prettier',
|
||||||
|
\'coc-tsserver',
|
||||||
|
\'coc-html',
|
||||||
|
\'coc-emmet',
|
||||||
|
\'coc-css',
|
||||||
|
\'coc-svg',
|
||||||
|
\'coc-svelte',
|
||||||
|
\'coc-jedi',
|
||||||
|
\'coc-json',
|
||||||
|
\'coc-yaml',
|
||||||
|
\'coc-snippets',
|
||||||
|
\'coc-clangd',
|
||||||
|
\'coc-bibtex',
|
||||||
|
\'coc-vimlsp',
|
||||||
|
\'coc-diagnostic',
|
||||||
|
\'coc-git'
|
||||||
|
\]
|
||||||
|
|
||||||
|
"
|
||||||
|
" Autocomplete
|
||||||
|
"
|
||||||
|
|
||||||
|
" `coc-snippets`
|
||||||
|
|
||||||
|
" TODO: is this block even necessary anymore?
|
||||||
|
"
|
||||||
|
" I use `coc-snippets-exand-jump` here as it is more flexible afaics
|
||||||
|
" As stated in the docs:
|
||||||
|
" `coc-snippets-expand` Expand snippet w/ current inserted text
|
||||||
|
" `coc-snippets-expand-jump` Expand snippet or jump to next placeholder of current snippet if possible
|
||||||
|
|
||||||
|
" Use tab for expansion in every context Don't use it for jumping as
|
||||||
|
" expansions have priority over jumping (which is not always what you want)
|
||||||
|
"
|
||||||
|
" E.g. You don't want to expand `time` to say `12:05` upon `<tab>`bing to go
|
||||||
|
" from arguments to body in a function snippet
|
||||||
|
|
||||||
|
inor <silent><expr> <TAB>
|
||||||
|
\ coc#pum#visible() ? coc#_select_confirm() :
|
||||||
|
\ coc#expandable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||||||
|
\ "\<TAB>"
|
||||||
|
|
||||||
|
" Use <c-j> and <c-k> to move through suggestions
|
||||||
|
" Open suggestions if not yet open
|
||||||
|
|
||||||
|
" inor <silent><expr> <c-j> coc#pum#visible() ? coc#pum#next(1) : coc#refresh()
|
||||||
|
inor <silent><expr> <c-space> coc#refresh()
|
||||||
|
inor <silent><expr> <c-j> coc#pum#visible() ? coc#pum#next(1) : coc#refresh()
|
||||||
|
|
||||||
|
" NOTE: As the followning interfered with digraphs, I replaced `coc#refresh`
|
||||||
|
" with `"\<C-g>u\<c-k>"` which afaik just does c-k when no completion menu is
|
||||||
|
" shown
|
||||||
|
" ```
|
||||||
|
" inor <silent><expr> <c-k> coc#pum#visible() ? coc#pum#prev(1) : coc#refresh()
|
||||||
|
" ```
|
||||||
|
|
||||||
|
inor <silent><expr> <c-k> coc#pum#visible() ? coc#pum#prev(1) : "\<C-g>u\<c-k>"
|
||||||
|
|
||||||
|
" NOTE: this is cutting text in visual mode, it is replaces `$VISUAL` on next
|
||||||
|
" expansion
|
||||||
|
"
|
||||||
|
" although I mapped it, I have yet to test this feature
|
||||||
|
|
||||||
|
vmap <tab> <plug>(coc-snippets-select)
|
||||||
|
|
||||||
|
ino <expr><cr> complete_info()["selected"] != "-1" ? "\<c-y>" : "\<c-g>u\<CR>"
|
||||||
|
|
||||||
|
" Show doccumentation
|
||||||
|
fu! s:show_documentation()
|
||||||
|
if (index(['vim','help'], &filetype) >= 0)
|
||||||
|
execute 'h '.expand('')
|
||||||
|
else
|
||||||
|
call CocAction('doHover')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
nn <leader>es :CocCommand snippets.editSnippets<cr>
|
||||||
|
" Code action on cursor position
|
||||||
|
nm <leader>do <plug>(coc-codeaction)
|
||||||
|
" Commands
|
||||||
|
com! -nargs=0 Prettier :CocCommand prettier.formatFile
|
|
@ -0,0 +1,177 @@
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Linting & (Auto)formatting
|
||||||
|
*/
|
||||||
|
|
||||||
|
"coc.preferences.formatOnType": true,
|
||||||
|
"coc.preferences.formatOnSave": true,
|
||||||
|
"prettier.configPath": ".prettierrc",
|
||||||
|
"prettier.ignorePath": ".prettierignore",
|
||||||
|
|
||||||
|
"prettier.semi": false,
|
||||||
|
"prettier.tabWidth": 2,
|
||||||
|
"prettier.singleQuote": true,
|
||||||
|
"prettier.arrowParens": "avoid",
|
||||||
|
"prettier.printWidth": 120,
|
||||||
|
"eslint.format.enable": true,
|
||||||
|
"eslint.onIgnoredFiles": "warn",
|
||||||
|
|
||||||
|
// Markdown
|
||||||
|
"markdownlint.config": {
|
||||||
|
"heading-style": {
|
||||||
|
"style": "atx"
|
||||||
|
},
|
||||||
|
"ul-style": {
|
||||||
|
"style": "asterisk"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language server & diagnostics
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Language server
|
||||||
|
"languageserver": {
|
||||||
|
// "racket": {
|
||||||
|
// "command": "racket",
|
||||||
|
// "args": ["--lib", "racket-langserver"],
|
||||||
|
// "filetypes": ["scheme", "racket"]
|
||||||
|
// }
|
||||||
|
"bash": {
|
||||||
|
"command": "bash-language-server",
|
||||||
|
"args": ["start"],
|
||||||
|
"filetypes": ["sh"]
|
||||||
|
},
|
||||||
|
"dockerfile": {
|
||||||
|
"command": "docker-langserver",
|
||||||
|
"args": ["--stdio"],
|
||||||
|
"filetypes": ["dockerfile"]
|
||||||
|
},
|
||||||
|
"haskell": {
|
||||||
|
"command": "haskell-language-server-wrapper",
|
||||||
|
"args": ["--lsp"],
|
||||||
|
"rootPatterns": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml"],
|
||||||
|
"filetypes": ["haskell", "lhaskell"],
|
||||||
|
"settings": {
|
||||||
|
"haskell": {
|
||||||
|
"formattingProvider": "stylish-haskell"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Run `haskell-language-server-wrapper generate-default-config` for a defult config
|
||||||
|
// "settings": { ... }
|
||||||
|
},
|
||||||
|
"R": {
|
||||||
|
"enable": true,
|
||||||
|
"command": "/usr/bin/R",
|
||||||
|
"args": ["--slave", "-e", "languageserver::run()"],
|
||||||
|
"filetypes": ["r"]
|
||||||
|
},
|
||||||
|
"prolog-lsp": {
|
||||||
|
"command": "swipl",
|
||||||
|
"args": ["-g", "use_module(library(lsp_server)).", "-g", "lsp_server:main", "-t", "halt", "--", "stdio"],
|
||||||
|
"filetypes": ["prolog"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"jedi.workspace.extraPaths": [
|
||||||
|
"/home/h/.local/lib/python3.8/site-packages",
|
||||||
|
"/home/h/.local/lib/python3.9/site-packages",
|
||||||
|
"/home/h/.local/lib/python3.10/site-packages",
|
||||||
|
"/home/h/.conda/envs/ml-2223/lib/python3.10/site-packages",
|
||||||
|
"/home/h/.conda/envs/nlp-2223/lib/python3.10/site-packages"
|
||||||
|
],
|
||||||
|
|
||||||
|
// Diagnostics
|
||||||
|
"diagnostic.infoSign": "🛈",
|
||||||
|
"diagnostic-languageserver.filetypes": {
|
||||||
|
"python": "pylint",
|
||||||
|
"systemd": "systemd-analyze"
|
||||||
|
},
|
||||||
|
"diagnostic-languageserver.linters": {
|
||||||
|
"pylint": {
|
||||||
|
"sourceName": "pylint",
|
||||||
|
"command": "pylint",
|
||||||
|
"debounce": 100,
|
||||||
|
"args": [
|
||||||
|
"--output-format",
|
||||||
|
"text",
|
||||||
|
"--score",
|
||||||
|
"no",
|
||||||
|
"--msg-template",
|
||||||
|
"'{line}:{column}:{category}:{msg} ({msg_id}:{symbol})'",
|
||||||
|
"%file"
|
||||||
|
],
|
||||||
|
"formatPattern": [
|
||||||
|
"^(\\d+?):(\\d+?):([a-z]+?):(.*)$",
|
||||||
|
{
|
||||||
|
"line": 1,
|
||||||
|
"column": 2,
|
||||||
|
"endColumn": 2,
|
||||||
|
"security": 3,
|
||||||
|
"message": 4
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rootPatterns": ["pyproject.toml", "setup.py", ".git"],
|
||||||
|
"securities": {
|
||||||
|
"informational": "hint",
|
||||||
|
"refactor": "info",
|
||||||
|
"convention": "info",
|
||||||
|
"warning": "warning",
|
||||||
|
"error": "error",
|
||||||
|
"fatal": "error"
|
||||||
|
},
|
||||||
|
"offsetColumn": 1,
|
||||||
|
"offsetColumnEnd": 1,
|
||||||
|
"formatLines": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Set up autopep8
|
||||||
|
"diagnostic-languageserver.formatters": {
|
||||||
|
"autopep8": {
|
||||||
|
"command": "autopep8",
|
||||||
|
"args": ["-"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"diagnostic-languageserver.formatFiletypes": {
|
||||||
|
"python": "autopep8"
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Autocompletion, suggestions, snippets
|
||||||
|
*/
|
||||||
|
|
||||||
|
"suggest.autoTrigger": "trigger",
|
||||||
|
"suggest.snippetIndicator": "▸",
|
||||||
|
"signature.target": "float",
|
||||||
|
"snippets.userSnippetsDirectory": "~/.vim/snips/",
|
||||||
|
"coc.source.file.triggerCharacters": ["/"],
|
||||||
|
|
||||||
|
// ECMAScript, TypeScript
|
||||||
|
"emmet.includeLanguages": { "javascript": "javascriptreact" },
|
||||||
|
"javascript.suggestionActions.enabled": true,
|
||||||
|
"typescript.suggestionActions.enabled": true,
|
||||||
|
"svelte.plugin.typescript.diagnostics.enable": true,
|
||||||
|
"svelte.enable-ts-plugin": true,
|
||||||
|
|
||||||
|
// Add BibTex file for coc-bibtex autocompletion
|
||||||
|
"list.source.bibtex.files": ["~/.zk/references.bib", "./*.bib"],
|
||||||
|
"bibtex.silent": true,
|
||||||
|
|
||||||
|
// Adjust floating menus
|
||||||
|
"hover.floatConfig": {
|
||||||
|
"border": true,
|
||||||
|
"highlight": "Normal"
|
||||||
|
},
|
||||||
|
"signature.floatConfig": {
|
||||||
|
"border": true,
|
||||||
|
"highlight": "Normal"
|
||||||
|
},
|
||||||
|
"diagnostic.floatConfig": {
|
||||||
|
"border": true,
|
||||||
|
"highlight": "Normal"
|
||||||
|
},
|
||||||
|
"suggest.pumFloatConfig": {
|
||||||
|
"border": true,
|
||||||
|
"highlight": "Normal"
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ call plug#begin()
|
||||||
Plug 'unblevable/quick-scope'
|
Plug 'unblevable/quick-scope'
|
||||||
Plug 'tpope/vim-commentary'
|
Plug 'tpope/vim-commentary'
|
||||||
Plug 'machakann/vim-sandwich'
|
Plug 'machakann/vim-sandwich'
|
||||||
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
Plug 'Shougo/context_filetype.vim'
|
Plug 'Shougo/context_filetype.vim'
|
||||||
Plug 'editorconfig/editorconfig-vim'
|
Plug 'editorconfig/editorconfig-vim'
|
||||||
Plug 'honza/vim-snippets'
|
Plug 'honza/vim-snippets'
|
||||||
|
|
Loading…
Reference in New Issue