From 210adb6461ec9ac8243f39e4efd6f78b041d4a01 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 1 Jul 2022 21:51:47 -0400 Subject: xdg-ified --- .bash_profile | 12 +++++------- .bashrc | 2 ++ .config/fish/config.fish | 19 ++----------------- .config/git/config | 10 ++++++++++ .config/nvim/coc-settings.json | 18 ++++++++++++++++++ .config/nvim/init.vim | 38 ++++++++++++++++++++++++++++++++++---- .config/shell/profile | 17 +++++++++++++++++ .config/zsh/.zshenv | 11 ++--------- .gitconfig | 10 ---------- 9 files changed, 90 insertions(+), 47 deletions(-) create mode 100644 .config/git/config create mode 100755 .config/nvim/coc-settings.json create mode 100644 .config/shell/profile delete mode 100644 .gitconfig diff --git a/.bash_profile b/.bash_profile index 070ea94..65cbbb1 100644 --- a/.bash_profile +++ b/.bash_profile @@ -9,11 +9,9 @@ then export PATH="$HOME/.local/bin:$PATH" fi -# default programs -export EDITOR='nvim' -export VISUAL='nvim' -export GPG_TTY=$TTY +source "$HOME/.config/shell/profile" -# paths -export CARGO_HOME="$HOME/.local/share/cargo" -export RUSTUP_HOME="$HOME/.local/share/rustup" +#if [[ $(ps --no-header --pid=$PPID --format=comm) != "fish" && -z ${BASH_EXECUTION_STRING} ]] +#then +# exec fish +#fi diff --git a/.bashrc b/.bashrc index 7847ca5..3ef6cf2 100644 --- a/.bashrc +++ b/.bashrc @@ -6,6 +6,8 @@ # always source profile source "$HOME/.bash_profile" +export HISTFILE="$XDG_STATE_HOME/bash/history" + # aliases alias ls='exa' alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 35da1bb..2af421a 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -3,20 +3,5 @@ # -# add ~/.local/bin to path if the directory exists -function add_local_bin - set -f dir "$HOME/.local/bin" - if test -e $dir; and not contains $dir $PATH - fish_add_path "$HOME/.local/bin" - end -end -add_local_bin - -# default programs -set -gx VISUAL nvim -set -gx EDITOR nvim -set -gx GPG_TTY (tty) - -# paths -set -gx CARGO_HOME "$HOME/.local/share/cargo" -set -gx RUSTUP_HOME "$HOME/.local/share/rustup" +# plugins +starship init fish | source diff --git a/.config/git/config b/.config/git/config new file mode 100644 index 0000000..1d7fad7 --- /dev/null +++ b/.config/git/config @@ -0,0 +1,10 @@ +[user] + email = getchoo@tuta.io + name = seth + signingkey = D31BD0D494BBEE86 +[commit] + gpgsign = true +[gpg] + program = gpg +[core] + pager = bat --style=changes diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json new file mode 100755 index 0000000..22e27a8 --- /dev/null +++ b/.config/nvim/coc-settings.json @@ -0,0 +1,18 @@ +{ + "languageserver": { + "bash": { + "command": "bash-language-server", + "args": [ + "start" + ], + "filetypes": [ + "sh", + "PKGBUILD" + ] + } + }, + "python.linting.flake8Enabled": true, + "coc.preferences.formatOnSaveFiletypes": [ + "json" + ] +} diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 3589bf3..cbedb8e 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -6,10 +6,32 @@ call plug#begin() Plug 'itchyny/lightline.vim' -Plug 'ayu-theme/ayu-vim' +Plug 'joshdick/onedark.vim' +Plug 'arcticicestudio/nord-vim' +Plug 'rose-pine/neovim', {'as': 'rose-pine'} +Plug 'neoclide/coc.nvim', {'branch': 'release'} call plug#end() +" coc settings +"" use for trigger completion and navigate to the next complete item +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~ '\s' +endfunction + +"" for lightline.vim +function! CocCurrentFunction() + return get(b:, 'coc_current_function', '') +endfunction + +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() + +inoremap pumvisible() ? "\" : "\" + " options set tabstop=2 set shiftwidth=2 @@ -20,7 +42,15 @@ set smartindent syntax on filetype plugin indent on set termguicolors -let ayucolor="mirage" -colorscheme ayu +colorscheme onedark let g:lightline = { - \ 'colorscheme': 'ayu_mirage'} + \ 'colorscheme': 'onedark', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'cocstatus', 'currentfunction', 'readonly', 'filename', 'modified' ] ] + \ }, + \ 'component_function': { + \ 'cocstatus': 'coc#status', + \ 'currentfunction': 'CocCurrentFunction' + \ }, + \ } diff --git a/.config/shell/profile b/.config/shell/profile new file mode 100644 index 0000000..804ff2a --- /dev/null +++ b/.config/shell/profile @@ -0,0 +1,17 @@ +# default programs +export EDITOR='nvim' +export VISUAL='nvim' +export GPG_TTY=$TTY + +# xdg dirs +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_STATE_HOME="$HOME/.local/state" +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_DATA_DIRS="/usr/local/share/:/usr/share/" +export XDG_CONFIG_DIRS="/etc/xdg" + +# paths +export CARGO_HOME="$XDG_DATA_HOME/cargo" +export RUSTUP_HOME="$XDG_DATA_HOME/rustup" +export LESSHISTFILE="$XDG_STATE_HOME/less/history" diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index ce840bc..c32ce0b 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -11,12 +11,5 @@ if [[ -d "$HOME/.local/bin" ]]; then export PATH fi -# default programs -export EDITOR='nvim' -export VISUAL='nvim' -export GPG_TTY=$TTY - -# paths -export ZDOTDIR="$HOME/.config/zsh" -export CARGO_HOME="$HOME/.local/share/cargo" -export RUSTUP_HOME="$HOME/.local/share/rustup" +source "$HOME/.config/shell/profile" +ZDOTDIR="$XDG_CONFIG_HOME/zsh" diff --git a/.gitconfig b/.gitconfig deleted file mode 100644 index 1d7fad7..0000000 --- a/.gitconfig +++ /dev/null @@ -1,10 +0,0 @@ -[user] - email = getchoo@tuta.io - name = seth - signingkey = D31BD0D494BBEE86 -[commit] - gpgsign = true -[gpg] - program = gpg -[core] - pager = bat --style=changes -- cgit v1.2.3