From 6a748d591e2044f5e0321ef993d07929660d7b2b Mon Sep 17 00:00:00 2001 From: odas0R Date: Sun, 27 Mar 2022 13:19:53 +0000 Subject: [PATCH 01/22] moved to ubuntu vm --- bash/bash | 2 +- bash/fzf.sh | 9 +++------ bash/path.sh | 22 +++------------------- bashrc | 12 +++--------- fonts/setup | 20 -------------------- git/setup | 19 +++---------------- install/bat | 11 +++++++++++ install/fd | 7 +++++++ install/fzf | 2 +- install/go-air | 11 ----------- install/golang | 6 ++++-- install/neovim | 5 +++++ install/nvm | 9 +++++++++ install/rg | 5 +++++ lazygit/setup | 20 +++----------------- nvim/init.vim | 2 +- nvim/lua/odas0r/telescope.lua | 1 + nvim/plugin/checkbox.vim | 2 -- nvim/plugin/colorscheme.vim | 2 +- nvim/plugin/defx.vim | 2 -- nvim/plugin/harpoon.vim | 2 -- nvim/plugin/telescope.vim | 2 -- nvim/setup | 8 ++++---- nvim/spell/spell | 2 +- nvim/ultisnips/sh.snippets | 22 ++++------------------ nvim/ultisnips/ultisnips | 2 +- package-lock.json | 6 ------ package.json | 1 - scripts/lg | 10 +++++++++- scripts/slugify | 21 +++------------------ tmux/tmux.conf | 10 +++------- 31 files changed, 86 insertions(+), 169 deletions(-) delete mode 100755 fonts/setup create mode 100755 install/bat create mode 100755 install/fd delete mode 100755 install/go-air create mode 100755 install/nvm create mode 100755 install/rg delete mode 100644 package-lock.json delete mode 100644 package.json diff --git a/bash/bash b/bash/bash index 9b64c2b..8adb255 120000 --- a/bash/bash +++ b/bash/bash @@ -1 +1 @@ -/Users/odas0r/dot/bash \ No newline at end of file +/home/odas0r/dot/bash \ No newline at end of file diff --git a/bash/fzf.sh b/bash/fzf.sh index 274c833..c3dcf4a 100644 --- a/bash/fzf.sh +++ b/bash/fzf.sh @@ -8,8 +8,10 @@ FD_OPTIONS="--follow --exclude .git --exclude node_modules" FZF_BINDS="--bind 'f2:toggle-preview,ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-/:toggle-all'" FZF_STYLES="--height=90% --layout=reverse --preview-window right:60%" +# --color=fg:#c0caf5,bg:#1a1b26,hl:#bb9af7 + FZF_TOKYO_THEME=' - --color=fg:#c0caf5,bg:#1a1b26,hl:#bb9af7 + --color=fg:#c0caf5,hl:#bb9af7 --color=fg+:#c0caf5,bg+:#1a1b26,hl+:#7dcfff --color=info:#7aa2f7,prompt:#7dcfff,pointer:#7dcfff --color=marker:#9ece6a,spinner:#9ece6a,header:#9ece6a' @@ -19,8 +21,3 @@ export FZF_DEFAULT_OPTS="--no-mouse ${FZF_STYLES} ${FZF_BINDS} ${FZF_TOKYO_THEME export FZF_DEFAULT_COMMAND="fd --hidden --type f --type l ${FD_OPTIONS}" export FZF_CTRL_T_COMMAND="fd ${FD_OPTIONS}" export FZF_ALT_C_COMMAND="fd --type d ${FD_OPTIONS}" - -# To install fd -# sudo apt install fd-find -# ln -s $(which fdfind) ~/.local/bin/fd -# Make sure that $HOME/.local/bin is in your $PATH. diff --git a/bash/path.sh b/bash/path.sh index 11f5a20..ab57cad 100644 --- a/bash/path.sh +++ b/bash/path.sh @@ -12,9 +12,9 @@ export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm # Java -export JAVA_HOME=$(/usr/libexec/java_home -v 16) -export JUNIT_HOME="$HOME/java" -export CLASSPATH="$CLASSPATH:$JUNIT_HOME/junit-4.13.2.jar:$JUNIT_HOME/hamcrest-core-1.3.jar" +# export JAVA_HOME=$(/usr/libexec/java_home -v 17) +# export JUNIT_HOME="$HOME/java" +# export CLASSPATH="$CLASSPATH:$JUNIT_HOME/junit-4.13.2.jar:$JUNIT_HOME/hamcrest-core-1.3.jar" # Go export GOROOT="/usr/local/go" @@ -26,22 +26,6 @@ export CARGOPATH="/home/odas0r/.cargo" # Tools export LUA_LSP="$TOOLS/lua-language-server/bin/Linux" -# WSL Shit -if [ -n "$WSL_DISTRO_NAME" ]; then - # Desktop Global Variable - export DESKTOP="/mnt/c/Users/guilh/Desktop" - - # Browser on WSL - export BROWSER="/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe" - - # Perl - export PERLPATH="/home/odas0r/perl5" - export PERL5LIB="/home/odas0r/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}" - export PERL_LOCAL_LIB_ROOT="/home/odas0r/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}" - export PERL_MB_OPT='--install_base "/home/odas0r/perl5"' - export PERL_MM_OPT="INSTALL_BASE=/home/odas0r/perl5" -fi - # MacOS Shit if [[ $OSTYPE == "darwin"* ]]; then # CoreUtils for macos diff --git a/bashrc b/bashrc index 2d4d769..4ebf59c 100644 --- a/bashrc +++ b/bashrc @@ -1,8 +1,3 @@ - -#### FIG ENV VARIABLES #### -# Please make sure this block is at the start of this file. -[ -s ~/.fig/shell/pre.sh ] && source ~/.fig/shell/pre.sh -#### END FIG ENV VARIABLES #### #!/usr/bin/env bash if [ -e /etc/bashrc ]; then @@ -18,7 +13,6 @@ for file in $HOME/.bash/autocomplete/*.sh; do . $file done -#### FIG ENV VARIABLES #### -# Please make sure this block is at the end of this file. -[ -s ~/.fig/fig.sh ] && source ~/.fig/fig.sh -#### END FIG ENV VARIABLES #### +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion diff --git a/fonts/setup b/fonts/setup deleted file mode 100755 index cd90b0e..0000000 --- a/fonts/setup +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -e - -fontPath="$HOME/.local/share/fonts" - -# create the folder for fonts -mkdir -p "$fontPath" - -readarray -d '' fonts < <( - find "$HOME/dot/fonts" -mindepth 1 -type f -name '*.ttf' -) - -# install fonts -for font in $fonts; do - cp "$font" "$fontPath" -done - -# clear the cache and regenerate the fonts -fc-cache -f -v diff --git a/git/setup b/git/setup index 11395a8..3249b40 100755 --- a/git/setup +++ b/git/setup @@ -5,24 +5,11 @@ set -euo pipefail declare DISTRO declare -r GIT_PATH="$HOME/dot/git" -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - DISTRO=$(awk -F= '/^NAME/{print ${2}}' /etc/os-release) - - if [[ ${DISTRO} = "Ubuntu"* ]]; then - if uname -a | grep -q '^Linux.*Microsoft'; then - # ubuntu via WSL Windows Subsystem for Linux - ln -sf "$GIT_PATH/gitconfig" "$HOME/.gitconfig" - else - # native ubuntu - ln -sf "$GIT_PATH/gitconfig" "$HOME/.gitconfig" - fi - elif [[ ${DISTRO} = "Debian"* ]]; then - # debian - ln -sf "$GIT_PATH/gitconfig" "$HOME/.gitconfig" - fi -elif [[ "$OSTYPE" == "darwin"* ]]; then +if [[ "$OSTYPE" == "darwin"* ]]; then # macOS OSX ln -sf "$GIT_PATH/gitconfig_darwin" "$HOME/.gitconfig" +else + ln -sf "$GIT_PATH/gitconfig" "$HOME/.gitconfig" fi printf "Git setup done! 🌟\n" diff --git a/install/bat b/install/bat new file mode 100755 index 0000000..af04903 --- /dev/null +++ b/install/bat @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -e + +VERSION=0.18.2 + +mkdir /tmp/bat-install && cd /tmp/bat-install + +curl -OL https:/github.com/sharkdp/bat/releases/download/v${VERSION}/bat_${VERSION}_amd64.deb + +sudo dpkg -i bat_0.18.2_amd64.deb diff --git a/install/fd b/install/fd new file mode 100755 index 0000000..8522be3 --- /dev/null +++ b/install/fd @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +sudo apt install fd-find + +ln -s $(which fdfind) ~/.local/bin/fd diff --git a/install/fzf b/install/fzf index aeee69f..1abc4ce 100755 --- a/install/fzf +++ b/install/fzf @@ -11,5 +11,5 @@ else mkdir -p /tmp/fzf cd /tmp/fzf git clone --depth 1 https://github.com/junegunn/fzf.git . - ~/.fzf/install + ./install fi diff --git a/install/go-air b/install/go-air deleted file mode 100755 index 1d92b6d..0000000 --- a/install/go-air +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [[ ! -x "$(command -v go)" ]]; then - echo "you need to instal golang!" - echo "check dot/install/golang" - exit 1 -fi - -curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin diff --git a/install/golang b/install/golang index f56bd64..0bb88ce 100755 --- a/install/golang +++ b/install/golang @@ -2,14 +2,16 @@ set -e -version=$(curl https://golang.org/VERSION?m=text) +version=$(curl https://go.dev/VERSION?m=text) +echo "VERSION: $version" + os="linux" arch="amd64" tarFile="${version}.${os}-${arch}.tar.gz" url="https://golang.org/dl/${tarFile}" # Download the latest golang -wget --quiet --continue --show-progress "${url}" +wget --continue --show-progress "${url}" printf "Downloaded Golang!\n" # Remove the old golang diff --git a/install/neovim b/install/neovim index 2d11b3d..33491d7 100755 --- a/install/neovim +++ b/install/neovim @@ -17,3 +17,8 @@ mv nvim.appimage nvim chmod u+x ./nvim sudo mv ./nvim /usr/bin + +# install nvr + +sudo apt install python3-pip +pip3 install neovim-remote diff --git a/install/nvm b/install/nvm new file mode 100755 index 0000000..e8b8c3c --- /dev/null +++ b/install/nvm @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +VERSION=0.38.0 + +curl-o- "https://raw.githubusercontent.com/nvm-sh/nvm/v${VERSION}/install.sh" | bash + +nvm install node diff --git a/install/rg b/install/rg new file mode 100755 index 0000000..a54516d --- /dev/null +++ b/install/rg @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +sudo apt-get install ripgrep diff --git a/lazygit/setup b/lazygit/setup index 4eb45a5..124958a 100755 --- a/lazygit/setup +++ b/lazygit/setup @@ -5,24 +5,10 @@ if [[ ! -x "$(command -v lazygit)" ]]; then exit 1 fi -declare DISTRO -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - DISTRO=$(awk -F= '/^NAME/{print ${2}}' /etc/os-release) - - if [[ ${DISTRO} = "Ubuntu"* ]]; then - if uname -a | grep -q '^Linux.*Microsoft'; then - # ubuntu via WSL Windows Subsystem for Linux - echo "SETUP NOT IMPLEMENTED: lazygit" - else - # native ubuntu - echo "SETUP NOT IMPLEMENTED: lazygit" - fi - elif [[ ${DISTRO} = "Debian"* ]]; then - # debian - echo "SETUP NOT IMPLEMENTED: lazygit" - fi -elif [[ "$OSTYPE" == "darwin"* ]]; then +if [[ "$OSTYPE" == "darwin"* ]]; then # macOS OSX ln -sf "$HOME/dot/lazygit/config.yml" "$HOME/Library/Application Support/lazygit/config.yml" +else + ln -sf "$HOME/dot/lazygit/config.yml" "$HOME/.config/lazygit/config.yml" fi diff --git a/nvim/init.vim b/nvim/init.vim index 6e235d8..af20d07 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -214,5 +214,5 @@ augroup remember_folds augroup END lua << EOF -require("plenary.reload").reload_module("odas0r", true) + require("plenary.reload").reload_module("odas0r", true) EOF diff --git a/nvim/lua/odas0r/telescope.lua b/nvim/lua/odas0r/telescope.lua index 61a97a6..c6535b9 100644 --- a/nvim/lua/odas0r/telescope.lua +++ b/nvim/lua/odas0r/telescope.lua @@ -33,6 +33,7 @@ require("telescope").setup({ }, extensions = { fzf = { + fuzzy = true, case_mode = "smart_case", }, }, diff --git a/nvim/plugin/checkbox.vim b/nvim/plugin/checkbox.vim index 060d46d..d9c4d23 100644 --- a/nvim/plugin/checkbox.vim +++ b/nvim/plugin/checkbox.vim @@ -1,4 +1,2 @@ -lua require("odas0r") - nnoremap x :lua require("odas0r/checkbox").toggle() vnoremap x :lua require("odas0r/checkbox").toggle_many() diff --git a/nvim/plugin/colorscheme.vim b/nvim/plugin/colorscheme.vim index 2f37d3e..aeebbdd 100644 --- a/nvim/plugin/colorscheme.vim +++ b/nvim/plugin/colorscheme.vim @@ -4,9 +4,9 @@ let g:tokyonight_style = "night" let g:tokyonight_italic_functions = 1 +let g:tokyonight_transparent = 1 colorscheme tokyonight - " change themes nnoremap 8 :let g:tokyonight_style = "night":colorscheme default:colorscheme tokyonight nnoremap 9 :let g:tokyonight_style = "day":colorscheme default:colorscheme tokyonight diff --git a/nvim/plugin/defx.vim b/nvim/plugin/defx.vim index 431805f..30dbf59 100644 --- a/nvim/plugin/defx.vim +++ b/nvim/plugin/defx.vim @@ -2,8 +2,6 @@ " " Press "K" on when cursor on top of defx -lua require("odas0r") - nnoremap \ :Defx -search=`expand('%:p')` `expand('%:p:h')` function! DefxMappings() " open a file with left mouse click diff --git a/nvim/plugin/harpoon.vim b/nvim/plugin/harpoon.vim index b993e9e..dc20c89 100644 --- a/nvim/plugin/harpoon.vim +++ b/nvim/plugin/harpoon.vim @@ -1,7 +1,5 @@ " Documentation: https://github.com/ThePrimeagen/harpoon -lua require("odas0r") - nnoremap a :lua require("harpoon.mark").add_file() nnoremap :lua require("harpoon.ui").toggle_quick_menu() diff --git a/nvim/plugin/telescope.vim b/nvim/plugin/telescope.vim index ba28641..edf43e4 100644 --- a/nvim/plugin/telescope.vim +++ b/nvim/plugin/telescope.vim @@ -2,8 +2,6 @@ " " Press "K" on when cursor on top of telescope -lua require("odas0r") - nnoremap Telescope git_files nnoremap Telescope live_grep nnoremap b Telescope buffers diff --git a/nvim/setup b/nvim/setup index 491d2b5..2b17d1c 100755 --- a/nvim/setup +++ b/nvim/setup @@ -20,9 +20,9 @@ ln -sf "$HOME/dot/nvim/spell" "$NVIM/spell" mkdir -p "$HOME/snippets" ln -sf "$HOME/dot/nvim/ultisnips" "$HOME/snippets/ultisnips" -# setup lua -mkdir -p "$NVIM/lua" -ln -sf "$HOME/dot/nvim/lua" "$NVIM/lua" +# setup lua and plugins +ln -sf "$HOME/dot/nvim/lua" "$NVIM" +ln -sf "$HOME/dot/nvim/plugin" "$NVIM" # installing plug if [[ ! -f "$NVIM/autoload/plug.vim" ]]; then @@ -32,4 +32,4 @@ fi printf "To install all vim plugins :PlugInstall!\n" -echo "Vim setup done! 🌟" +echo "Neovim setup done! 🌟" diff --git a/nvim/spell/spell b/nvim/spell/spell index 3742135..b5dce9f 120000 --- a/nvim/spell/spell +++ b/nvim/spell/spell @@ -1 +1 @@ -/Users/odas0r/dot/nvim/spell \ No newline at end of file +/home/odas0r/dot/nvim/spell \ No newline at end of file diff --git a/nvim/ultisnips/sh.snippets b/nvim/ultisnips/sh.snippets index 740231b..b50ff6b 100644 --- a/nvim/ultisnips/sh.snippets +++ b/nvim/ultisnips/sh.snippets @@ -60,26 +60,12 @@ fi endsnippet snippet os "check if command exists" b -declare DISTRO - -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - DISTRO=$(awk -F= '/^NAME/{print \${2}}' /etc/os-release) - - if [[ ${DISTRO} = "Ubuntu"* ]]; then - if uname -a | grep -q '^Linux.*Microsoft'; then - # ubuntu via WSL Windows Subsystem for Linux - echo "NOT IMPLEMENTED" - else - # native ubuntu - echo "NOT IMPLEMENTED" - fi - elif [[ ${DISTRO} = "Debian"* ]]; then - # debian - echo "NOT IMPLEMENTED" - fi -elif [[ "$OSTYPE" == "darwin"* ]]; then +if [[ "$OSTYPE" == "darwin"* ]]; then # macOS OSX echo "NOT IMPLEMENTED" +else + # debian + echo "NOT IMPLEMENTED" fi endsnippet diff --git a/nvim/ultisnips/ultisnips b/nvim/ultisnips/ultisnips index e0afce7..f9e1186 120000 --- a/nvim/ultisnips/ultisnips +++ b/nvim/ultisnips/ultisnips @@ -1 +1 @@ -/Users/odas0r/dot/nvim/ultisnips \ No newline at end of file +/home/odas0r/dot/nvim/ultisnips \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index b19d3da..0000000 --- a/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "dot", - "lockfileVersion": 2, - "requires": true, - "packages": {} -} diff --git a/package.json b/package.json deleted file mode 100644 index 0967ef4..0000000 --- a/package.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/scripts/lg b/scripts/lg index 19a35c0..4be6664 100755 --- a/scripts/lg +++ b/scripts/lg @@ -2,9 +2,17 @@ set -e +is_in_git_repo() { + git rev-parse HEAD -- >/dev/null 2>&1 +} + +is_in_git_repo || (echo "You're not in a git repo" && exit 1) + if [[ ! -x "$(command -v lazygit)" ]]; then echo "You need to install lazygit" exit 1 fi -popup lazygit -p "$(pwd)" "$@" +root=$(git rev-parse --show-toplevel) + +popup lazygit -p "$root" "$@" diff --git a/scripts/slugify b/scripts/slugify index b4deac1..fa09c34 100755 --- a/scripts/slugify +++ b/scripts/slugify @@ -2,24 +2,9 @@ set -euo pipefail -DISTRO=: - -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - DISTRO=$(awk -F= '/^NAME/{print ${2}}' /etc/os-release) - - if [[ ${DISTRO} = "Ubuntu"* ]]; then - if uname -a | grep -q '^Linux.*Microsoft'; then - # ubuntu via WSL Windows Subsystem for Linux - iconv -t ascii//TRANSLIT | sed -r s/[~'^']+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr "[:upper:]" "[:lower:]" - else - # native ubuntu - echo "NOT IMPLEMENTED" - fi - elif [[ ${DISTRO} = "Debian"* ]]; then - # debian - echo "NOT IMPLEMENTED" - fi -elif [[ "$OSTYPE" == "darwin"* ]]; then +if [[ "$OSTYPE" == "darwin"* ]]; then # macOS OSX iconv -t ascii//TRANSLIT | sed -E s/[~'^']+//g | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr "[:upper:]" "[:lower:]" +else + iconv -t ascii//TRANSLIT | sed -r s/[~'^']+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr "[:upper:]" "[:lower:]" fi diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 453e06f..d70ba3b 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -31,8 +31,9 @@ set -g status-right-length 30 set -g set-clipboard on # needed if using kitty-terminal -set -g default-terminal xterm-kitty -# set -g default-terminal "tmux-256color" +# set -g default-terminal xterm-kitty +set -g default-terminal "tmux-256color" + # Undercurl # https://github.com/folke/tokyonight.nvim#making-undercurls-work-properly-in-tmux @@ -81,8 +82,3 @@ bind-key -r k select-pane -U bind-key -r j select-pane -D bind-key -r h select-pane -L bind-key -r l select-pane -R - - -# Fig Tmux Integration: Enabled -source-file ~/.fig/tmux -# End of Fig Tmux Integration From 6a34461bbe9c518928702744298ea7d2211b1ed9 Mon Sep 17 00:00:00 2001 From: odas0R Date: Sun, 27 Mar 2022 15:42:14 +0000 Subject: [PATCH 02/22] fixed tmux colors --- install/lua-language-server | 2 +- nvim/init.vim | 15 ++++++++++----- nvim/lua/odas0r/efm.lua | 2 ++ nvim/plugin/yank.vim | 17 +++++++++++++++++ tmux/tmux.conf | 4 +++- 5 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 nvim/plugin/yank.vim diff --git a/install/lua-language-server b/install/lua-language-server index ff5cea3..12d2613 100755 --- a/install/lua-language-server +++ b/install/lua-language-server @@ -6,7 +6,7 @@ set -e mkdir -p $HOME/tools/ cd $HOME/tools -git clone --depth=1 https://hub.fastgit.org/sumneko/lua-language-server +git clone --depth=1 https://github.com/sumneko/lua-language-server cd lua-language-server git submodule update --init --recursive diff --git a/nvim/init.vim b/nvim/init.vim index af20d07..37411e0 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -49,11 +49,8 @@ set foldmethod=manual set spelllang+=pt_pt set encoding=utf-8 -" on yank copy to clipboard -set clipboard+=unnamedplus - " set the cursor fat on insert -set guicursor=i:block +" set guicursor=i:block " Return to last edit position when opening files au BufReadPost * @@ -142,6 +139,9 @@ Plug 'neovim/nvim-lspconfig' Plug 'onsails/lspkind-nvim' Plug 'jose-elias-alvarez/nvim-lsp-ts-utils' +" yank over OSC +Plug 'ojroques/vim-oscyank', {'branch': 'main'} + " completion Plug 'hrsh7th/nvim-cmp' Plug 'hrsh7th/cmp-path' @@ -202,11 +202,12 @@ let g:db="postgres://postgres:postgres@localhost:5432/postgres" let g:vim_dadbod_completion_mark = 'SQL' let g:completion_matching_ignore_case = 1 + " " Folding " let g:markdown_folding = 1 -" + augroup remember_folds autocmd! autocmd BufWinLeave *.md mkview @@ -214,5 +215,9 @@ augroup remember_folds augroup END lua << EOF + -- import all configs + require("odas0r") + + -- Reload modules on save require("plenary.reload").reload_module("odas0r", true) EOF diff --git a/nvim/lua/odas0r/efm.lua b/nvim/lua/odas0r/efm.lua index 54b7ec6..392c347 100644 --- a/nvim/lua/odas0r/efm.lua +++ b/nvim/lua/odas0r/efm.lua @@ -1,3 +1,5 @@ +-- go install github.com/mattn/efm-langserver@latest + local on_attach = function(_, bufnr) local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) diff --git a/nvim/plugin/yank.vim b/nvim/plugin/yank.vim new file mode 100644 index 0000000..885423e --- /dev/null +++ b/nvim/plugin/yank.vim @@ -0,0 +1,17 @@ +" Docs: https://github.com/ojroques/vim-oscyank#copying-from-a-register + +" > For the impatient one, copy this line to your config. Content will be +" > copied to clipboard after any yank operation: + +" on yank copy to clipboard +set clipboard+=unnamedplus + +let g:oscyank_max_length = 1000000 + +let g:oscyank_term = 'default' + +let g:clipboard = { + \ 'name': 'osc53', + \ 'copy': {'+': {lines, regtype -> OSCYankString(join(lines, "\n"))}}, + \ 'paste': {'+': {-> [split(getreg(''), '\n'), getregtype('')]}}, + \ } diff --git a/tmux/tmux.conf b/tmux/tmux.conf index d70ba3b..52b818c 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -11,6 +11,7 @@ set-option -g renumber-windows on set -g base-index 1 setw -g pane-base-index 1 set -g mouse on +set-option -g focus-events on # colors set -g status-style fg="#a9b1d6" @@ -32,7 +33,8 @@ set -g set-clipboard on # needed if using kitty-terminal # set -g default-terminal xterm-kitty -set -g default-terminal "tmux-256color" +set -g default-terminal 'tmux-256color' +set -ga terminal-overrides ',tmux-256color:Tc' # Undercurl From 21b7be59ef0f162b61838be60d9b604a792754f8 Mon Sep 17 00:00:00 2001 From: odas0R Date: Tue, 29 Mar 2022 08:08:42 +0000 Subject: [PATCH 03/22] another commit :) --- bash/aliases.sh | 35 ++++++++++++++--------------------- bash/git-ssh.sh | 23 +++++++++++++++++++++++ git/gitconfig | 2 -- install/fzf | 6 ++---- scripts/docker-fix | 5 +++++ scripts/exe | 5 +++++ scripts/nr | 2 +- scripts/zet | 2 +- 8 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 bash/git-ssh.sh create mode 100755 scripts/docker-fix create mode 100755 scripts/exe diff --git a/bash/aliases.sh b/bash/aliases.sh index b99d322..3868092 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -1,35 +1,28 @@ #!/usr/bin/env bash -# Vi -alias vimdiff="nvim -d" - -# ngrok aliases -alias ng-pg="ngrok tcp --region=eu --remote-addr=3.tcp.eu.ngrok.io:22146 5432" - -# Shortcuts -alias fonts="open ~/.local/share/fonts" -alias horario="open ~/zet/assets/horario.png" -alias kitty="nvim ~/.config/kitty/kitty.conf" - -alias lazydocker="TERM=xterm-kitty lazydocker" - # Utils alias ..="cd .." alias ls="ls --format=single-column --classify --color --group-directories-first" alias la="ls -la" alias sb="source ~/.bashrc" -if [[ $OSTYPE == "darwin"* ]]; then - alias ls="/usr/local/bin/gls --format=single-column --classify --color --group-directories-first" - alias la="/usr/local/bin/gls --format=single-column --classify --color --group-directories-first -la" - alias find="/usr/local/bin/gfind" -fi +# Use nvr to avoid nesting nvim in Terminal buffers. +alias nvim="nvim-nvr" # you can't cd on the current shell process by "cd-ing" on a shell script # https://stackoverflow.com/questions/255414/why-cant-i-change-directories-using-cd-in-a-script jump() { - [ -h "$MARKPATH/$1" ] && cd "$(readlink "${MARKPATH}/${1}")" || exit 1 + [ -h "$MARKPATH/$1" ] && cd "$(readlink "${MARKPATH}/${1}")" || echo "mark not found :(" } -# Use nvr to avoid nesting nvim in Terminal buffers. -alias nvim="nvim-nvr" +# cd into repos where you'll want to work on +repos() { + local GITHUB_PATH="$HOME/github.com" + + repo=$( + find "$GITHUB_PATH" -mindepth 2 -maxdepth 2 -type d | + fzf-tmux -p 30% --prompt="Search your repositories >" + ) + + cd "$repo" +} diff --git a/bash/git-ssh.sh b/bash/git-ssh.sh new file mode 100644 index 0000000..b90f915 --- /dev/null +++ b/bash/git-ssh.sh @@ -0,0 +1,23 @@ +# Reference: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases + +env=~/.ssh/agent.env + +agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } + +agent_start () { + (umask 077; ssh-agent >| "$env") + . "$env" >| /dev/null ; } + +agent_load_env + +# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2=agent not running +agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?) + +if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then + agent_start + ssh-add +elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then + ssh-add +fi + +unset env diff --git a/git/gitconfig b/git/gitconfig index 03ecdfa..fa6238f 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -8,8 +8,6 @@ editor = nvim [init] defaultBranch = main -[credential "https://github.com"] - helper = ! auth git-credential [merge] tool = "nvim -d" conflictstyle = diff3 diff --git a/install/fzf b/install/fzf index 1abc4ce..7b4e0d9 100755 --- a/install/fzf +++ b/install/fzf @@ -8,8 +8,6 @@ if [[ $OSTYPE == "darwin"* ]]; then $(brew --prefix)/opt/fzf/install else # install with github - mkdir -p /tmp/fzf - cd /tmp/fzf - git clone --depth 1 https://github.com/junegunn/fzf.git . - ./install + git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.fzf + $HOME/.fzf/install fi diff --git a/scripts/docker-fix b/scripts/docker-fix new file mode 100755 index 0000000..e737e6f --- /dev/null +++ b/scripts/docker-fix @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +sudo systemctl restart docker.socket docker.service diff --git a/scripts/exe b/scripts/exe new file mode 100755 index 0000000..3d5165a --- /dev/null +++ b/scripts/exe @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +chmod +x "$@" diff --git a/scripts/nr b/scripts/nr index 2af263c..43d4f45 120000 --- a/scripts/nr +++ b/scripts/nr @@ -1 +1 @@ -/Users/odas0r/github.com/nr-cmd/nr \ No newline at end of file +/home/odas0r/github.com/odas0r/nr-cmd/nr \ No newline at end of file diff --git a/scripts/zet b/scripts/zet index b86591a..e7cb171 120000 --- a/scripts/zet +++ b/scripts/zet @@ -1 +1 @@ -/Users/odas0r/github.com/zet-cmd/zet \ No newline at end of file +/home/odas0r/github.com/odas0r/zet-cmd/zet \ No newline at end of file From c6d22991f77e42a40cdbca2d543a90fda765d411 Mon Sep 17 00:00:00 2001 From: odas0R Date: Wed, 30 Mar 2022 23:00:31 +0100 Subject: [PATCH 04/22] yea --- bash/aliases.sh | 2 +- bash/path.sh | 28 ++++++++++++++++------------ bashrc | 4 +--- git/gitconfig | 1 + install/go-migrate | 15 +++++++++++++++ install/lua-language-server | 4 ++++ nvim/init.vim | 8 +------- nvim/lua/odas0r/cmp.lua | 3 ++- nvim/lua/odas0r/lsp.lua | 17 +++-------------- nvim/ultisnips/javascript.snippets | 8 ++++++++ scripts/dot | 8 ++++++-- scripts/pgfmt | 1 - scripts/todos | 4 +++- tmux/tmux.conf | 4 ++-- 14 files changed, 63 insertions(+), 44 deletions(-) create mode 100755 install/go-migrate diff --git a/bash/aliases.sh b/bash/aliases.sh index 3868092..1baef53 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -21,7 +21,7 @@ repos() { repo=$( find "$GITHUB_PATH" -mindepth 2 -maxdepth 2 -type d | - fzf-tmux -p 30% --prompt="Search your repositories >" + fzf-tmux -p 40% --multi --prompt="Your repositories > " ) cd "$repo" diff --git a/bash/path.sh b/bash/path.sh index ab57cad..7019f46 100644 --- a/bash/path.sh +++ b/bash/path.sh @@ -24,18 +24,22 @@ export GOPATH="$HOME/go" export CARGOPATH="/home/odas0r/.cargo" # Tools -export LUA_LSP="$TOOLS/lua-language-server/bin/Linux" +export LUA_LANGUAGE_SERVER="$TOOLS/lua-language-server/bin" -# MacOS Shit -if [[ $OSTYPE == "darwin"* ]]; then - # CoreUtils for macos - # brew install coreutils - export GNU_UTILS="/usr/local/opt/coreutils/libexec/gnubin" - - # Tools - export LUA_LSP="$TOOLS/lua-language-server/bin/macOS" - -fi +# Perl +export PERLPATH="/hom/odas0r/perl5" +export PERL5LIB="/home/odas0r/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}" +export PERL_LOCAL_LIB_ROOT="/home/odas0r/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}" +export PERL_MB_OPT='--install_base "/home/odas0r/perl5"' +export PERL_MM_OPT="INSTALL_BASE=/home/odas0r/perl5" # Global Path -export PATH="$PATH:/bin:/usr/local/bin:$GOROOT/bin:$GOPATH/bin:$CARGOPATH/bin:$PERLPATH/bin:$LOCAL_BIN:$LOCAL_SCRIPTS:$LUA_LSP:$GNU_UTILS" +PATH="$PATH:/bin:/usr/local/bin:" +PATH+="$GOROOT/bin:$GOPATH/bin:" +PATH+="$CARGOPATH/bin:" +PATH+="$PERLPATH/bin:" +PATH+="$LOCAL_BIN:$LOCAL_SCRIPTS:" +PATH+="$LUA_LANGUAGE_SERVER:" +PATH+="$GNU_UTILS" + +export PATH diff --git a/bashrc b/bashrc index 4ebf59c..6e8b9a4 100644 --- a/bashrc +++ b/bashrc @@ -13,6 +13,4 @@ for file in $HOME/.bash/autocomplete/*.sh; do . $file done -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +alias luamake=/home/odas0r/tools/lua-language-server/3rd/luamake/luamake diff --git a/git/gitconfig b/git/gitconfig index fa6238f..4915c69 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -6,6 +6,7 @@ default = current [core] editor = nvim + autocrlf = false [init] defaultBranch = main [merge] diff --git a/install/go-migrate b/install/go-migrate new file mode 100755 index 0000000..14b81e1 --- /dev/null +++ b/install/go-migrate @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e + +version="v4.15.1" +platform="linux" + +mkdir -p /tmp/migrate +cd /tmp/migrate + +# download the migrate binary +curl -L https://github.com/golang-migrate/migrate/releases/download/$version/migrate.$platform-amd64.tar.gz | tar xvz + +# install the migrate binary +sudo install migrate /usr/local/bin diff --git a/install/lua-language-server b/install/lua-language-server index 12d2613..d772298 100755 --- a/install/lua-language-server +++ b/install/lua-language-server @@ -4,6 +4,10 @@ set -e # Docs: https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone) +if [[ -d "$HOME/tools/lua-language-server" ]]; then + rm -rf "$HOME/tools/lua-language-server" +fi + mkdir -p $HOME/tools/ cd $HOME/tools git clone --depth=1 https://github.com/sumneko/lua-language-server diff --git a/nvim/init.vim b/nvim/init.vim index 37411e0..150b17f 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -149,20 +149,14 @@ Plug 'hrsh7th/cmp-nvim-lua' Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-buffer' Plug 'quangnguyen30192/cmp-nvim-ultisnips' +Plug 'tzachar/cmp-tabnine', { 'do': './install.sh' } " formatter -" Plug 'lukas-reineke/format.nvim' Plug 'mhartington/formatter.nvim' " snippet Engine Plug 'sirver/UltiSnips' -" documentation -Plug 'heavenshell/vim-jsdoc', { - \ 'for': ['javascript', 'javascriptreact','typescript', 'typescriptreact'], - \ 'do': 'make install' -\} - " writing Plug 'preservim/vim-markdown' diff --git a/nvim/lua/odas0r/cmp.lua b/nvim/lua/odas0r/cmp.lua index 1e7e350..ea0d758 100644 --- a/nvim/lua/odas0r/cmp.lua +++ b/nvim/lua/odas0r/cmp.lua @@ -75,7 +75,7 @@ cmp.setup({ }, { name = "vim-dadbod-completion" }, - -- { name = "cmp_tabnine" }, + { name = "cmp_tabnine" }, { name = "ultisnips" }, }), @@ -92,6 +92,7 @@ cmp.setup({ nvim_lua = "[Lua]", nvim_lsp = "[Lsp]", path = "[Path]", + cmp_tabnine = "[TN]", ["vim-dadbod-completion"] = "[Sql]", gh_issues = "[Issue]", ultisnips = "[Snip]", diff --git a/nvim/lua/odas0r/lsp.lua b/nvim/lua/odas0r/lsp.lua index 1ecba3e..66b59ef 100644 --- a/nvim/lua/odas0r/lsp.lua +++ b/nvim/lua/odas0r/lsp.lua @@ -23,7 +23,7 @@ local lsp_keymaps = function(_, bufnr) end local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) - +local lsp_config = require("lspconfig").util; local debounce_text_changes = 150 -- npm install -g typescript typescript-language-server @@ -50,7 +50,6 @@ require("lspconfig").tsserver.setup({ }, import_all_scan_buffers = 100, import_all_select_source = false, - -- if false will avoid organizing imports always_organize_imports = true, -- filter diagnostics @@ -58,17 +57,7 @@ require("lspconfig").tsserver.setup({ filter_out_diagnostics_by_code = {}, -- inlay hints - auto_inlay_hints = true, - inlay_hints_highlight = "Comment", - inlay_hints_priority = 200, -- priority of the hint extmarks - inlay_hints_throttle = 150, -- throttle the inlay hint request - inlay_hints_format = { -- format options for individual hint kind - Type = {}, - Parameter = {}, - Enum = {}, - }, - - -- update imports on file move + auto_inlay_hints = false, update_imports_on_move = true, require_confirmation_on_move = false, watch_dir = nil, @@ -219,7 +208,7 @@ require("lspconfig").sumneko_lua.setup({ flags = { debounce_text_changes, }, - cmd = { sumneko_binary_path, "-E", sumneko_root_path .. "/main.lua" }, + cmd = { sumneko_binary_path, "-E", sumneko_root_path .. "/lua-language-server/main.lua" }, settings = { Lua = { runtime = { diff --git a/nvim/ultisnips/javascript.snippets b/nvim/ultisnips/javascript.snippets index b70e68e..a31eb59 100644 --- a/nvim/ultisnips/javascript.snippets +++ b/nvim/ultisnips/javascript.snippets @@ -40,6 +40,14 @@ if (${1:true}) { } endsnippet +snippet try "try-catch" b +try { + $0 +} catch(error) { + +} +endsnippet + snippet switch switch (${VISUAL}${1:expression}) { case '${VISUAL}${2:case}': diff --git a/scripts/dot b/scripts/dot index b726f1d..dafd714 100755 --- a/scripts/dot +++ b/scripts/dot @@ -8,8 +8,12 @@ if [[ -n $1 ]]; then exit 0 fi -cd "$HOME/dot" -file="$(fzf-tmux -p 95% --preview 'bat --theme=ansi --style=numbers --color=always {}')" +cd "$HOME/dot" +file=$( + fzf-tmux -p 95% --multi \ + --prompt="Search through your dotfiles > " \ + --preview 'bat --theme=ansi --style=numbers --color=always {}' +) if [[ -f $file ]]; then if [[ ${file: -4} =~ (.png|jpeg|gif) ]]; then diff --git a/scripts/pgfmt b/scripts/pgfmt index 32c4d5e..79ea2d2 100755 --- a/scripts/pgfmt +++ b/scripts/pgfmt @@ -10,6 +10,5 @@ LANG=C pg_format \ --comma-start \ --keyword-case 1 \ --wrap-comment \ - --wrap-limit 78 \ --nogrouping \ --no-extra-line diff --git a/scripts/todos b/scripts/todos index 9333f54..739cb4c 100755 --- a/scripts/todos +++ b/scripts/todos @@ -1,3 +1,5 @@ #!/usr/bin/env bash -popup -d "$HOME/github.com/zet" nvim "$HOME/github.com/zet/todos.md" +ZET="$HOME/github.com/odas0r/zet" + +popup -d "$ZET" nvim "$ZET/todos.md" diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 52b818c..239ca57 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -33,8 +33,8 @@ set -g set-clipboard on # needed if using kitty-terminal # set -g default-terminal xterm-kitty -set -g default-terminal 'tmux-256color' -set -ga terminal-overrides ',tmux-256color:Tc' +set -g default-terminal 'xterm-256color' +set -ga terminal-overrides ',xterm-256color:Tc' # Undercurl From ba5380b48dcea45219f9df43f6e71939f5f9059e Mon Sep 17 00:00:00 2001 From: odas0R Date: Mon, 4 Apr 2022 13:39:24 +0100 Subject: [PATCH 05/22] commit --- .gitignore | 2 + bash/ps1.sh | 4 +- gh/config.yml | 2 +- git/gitconfig | 21 +- install/kitty | 5 - install/stylua | 14 + lazygit/config.yml | 2 +- nvim/init.vim | 10 +- nvim/lua/odas0r/cmp.lua | 4 +- nvim/lua/odas0r/lsp.lua | 17 +- nvim/lua/odas0r/treesitter.lua | 8 - nvim/plugin/colorscheme.vim | 2 +- nvim/plugin/markdown.vim | 1 + nvim/plugin/zet.vim | 6 +- nvim/spell/en.utf-8.add | 7 + nvim/spell/en.utf-8.add.spl | Bin 5030 -> 5071 bytes nvim/ultisnips/go.snippets | 571 +++++++++++++++++++++++++++++---- .psqlrc => psqlrc | 0 scripts/lzd | 10 + scripts/{lg => lzg} | 0 scripts/tmuxin | 25 +- setup | 7 +- tmux/tmux.conf | 7 +- 23 files changed, 609 insertions(+), 116 deletions(-) create mode 100644 .gitignore delete mode 100755 install/kitty create mode 100755 install/stylua rename .psqlrc => psqlrc (100%) create mode 100755 scripts/lzd rename scripts/{lg => lzg} (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..104cfe2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# private scripts +./scripts/open diff --git a/bash/ps1.sh b/bash/ps1.sh index 90b8e21..6b4ba60 100644 --- a/bash/ps1.sh +++ b/bash/ps1.sh @@ -14,9 +14,9 @@ parse_git_branch() { # ret=$? # PS1=$(if [[ ${ret} = 0 ]]; then echo "👋 "; else echo "🐞 "; fi) -PS1="👋 " +PS1="=> " PS1+="$cyan/\W$reset" PS1+=" $magenta\$(parse_git_branch)$reset" PS1+="$ " -PS2="📝keep typing...> " +PS2="Keep typing...> " diff --git a/gh/config.yml b/gh/config.yml index 8545d42..8fcaa9a 100644 --- a/gh/config.yml +++ b/gh/config.yml @@ -4,4 +4,4 @@ prompt: enabled pager: less aliases: co: pr checkout -browser: "'/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe'" +browser: "open" diff --git a/git/gitconfig b/git/gitconfig index 4915c69..e77a41d 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -9,9 +9,20 @@ autocrlf = false [init] defaultBranch = main +[diff] + tool = nvr +[difftool "nvr"] + cmd = nvr -s -d $LOCAL $REMOTE [merge] - tool = "nvim -d" - conflictstyle = diff3 -[mergetool] - prompt = false - keepBackup = false + tool = nvr +[mergetool "nvr"] + cmd = nvr -s -d $LOCAL $BASE $REMOTE $MERGED -c 'wincmd J | wincmd =' + prompt = false + keepBackup = false + +; [merge] +; tool = "nvim -d" +; conflictstyle = diff3 +; [mergetool] +; prompt = false +; keepBackup = false diff --git a/install/kitty b/install/kitty deleted file mode 100755 index 9f3537a..0000000 --- a/install/kitty +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -e - -curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin diff --git a/install/stylua b/install/stylua new file mode 100755 index 0000000..7336ba2 --- /dev/null +++ b/install/stylua @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# create installer dir +mkdir -p /tmp/stylua-installer +cd /tmp/stylua-installer + +# download and install binary +VERSION=v0.13.0 +wget "https://github.com/JohnnyMorganz/StyLua/releases/download/$VERSION/stylua-linux.zip" +unzip stylua-linux.zip +sudo install stylua /usr/local/bin + +# cleanup +cd - && rm -rf /tmp/stylua-installer diff --git a/lazygit/config.yml b/lazygit/config.yml index 710e3d0..0576268 100644 --- a/lazygit/config.yml +++ b/lazygit/config.yml @@ -52,7 +52,7 @@ git: # one of always, never, when-maximised # this determines whether the git graph is rendered in the commits panel showGraph: 'when-maximised' - skipHookPrefix: WIP + skipHookPrefix: 'wip():' autoFetch: true branchLogCmd: 'git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --' allBranchesLogCmd: 'git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium' diff --git a/nvim/init.vim b/nvim/init.vim index 150b17f..3b37434 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -9,11 +9,15 @@ set autoindent set autoread set autowriteall -set relativenumber +set number set ruler set showmode set showcmd +" experimentation for performance +set lazyredraw +set ttyfast + set numberwidth=2 set laststatus=2 set nofixendofline @@ -149,7 +153,6 @@ Plug 'hrsh7th/cmp-nvim-lua' Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-buffer' Plug 'quangnguyen30192/cmp-nvim-ultisnips' -Plug 'tzachar/cmp-tabnine', { 'do': './install.sh' } " formatter Plug 'mhartington/formatter.nvim' @@ -170,7 +173,7 @@ au FileType * hi SpellBad ctermbg=NONE ctermfg=Red cterm=underline au FileType * hi Error ctermbg=NONE ctermfg=Red au FileType * hi ErrorMsg ctermbg=NONE ctermfg=Red -highlight htmlTitle gui=bold guifg=#e0af68 ctermfg=Yellow +" give colors to **bold** and *italic* highlight htmlBold gui=bold guifg=#e0af68 ctermfg=214 highlight htmlItalic gui=italic guifg=#bb9af7 ctermfg=214 @@ -196,7 +199,6 @@ let g:db="postgres://postgres:postgres@localhost:5432/postgres" let g:vim_dadbod_completion_mark = 'SQL' let g:completion_matching_ignore_case = 1 - " " Folding " diff --git a/nvim/lua/odas0r/cmp.lua b/nvim/lua/odas0r/cmp.lua index ea0d758..cf17b7a 100644 --- a/nvim/lua/odas0r/cmp.lua +++ b/nvim/lua/odas0r/cmp.lua @@ -75,7 +75,7 @@ cmp.setup({ }, { name = "vim-dadbod-completion" }, - { name = "cmp_tabnine" }, + -- { name = "cmp_tabnine" }, { name = "ultisnips" }, }), @@ -92,7 +92,7 @@ cmp.setup({ nvim_lua = "[Lua]", nvim_lsp = "[Lsp]", path = "[Path]", - cmp_tabnine = "[TN]", + -- cmp_tabnine = "[TN]", ["vim-dadbod-completion"] = "[Sql]", gh_issues = "[Issue]", ultisnips = "[Snip]", diff --git a/nvim/lua/odas0r/lsp.lua b/nvim/lua/odas0r/lsp.lua index 66b59ef..28f11b7 100644 --- a/nvim/lua/odas0r/lsp.lua +++ b/nvim/lua/odas0r/lsp.lua @@ -23,7 +23,9 @@ local lsp_keymaps = function(_, bufnr) end local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) -local lsp_config = require("lspconfig").util; + +local lsp_util = require("lspconfig").util; + local debounce_text_changes = 150 -- npm install -g typescript typescript-language-server @@ -31,7 +33,7 @@ require("lspconfig").tsserver.setup({ -- Needed for inlayHints. Merge this table with your settings or copy -- it from the source if you want to add your own init_options. init_options = require("nvim-lsp-ts-utils").init_options, - root_dir = require("lspconfig").util.root_pattern("package.json"), + root_dir = lsp_util.root_pattern("package.json"), on_attach = function(client, bufnr) local ts_utils = require("nvim-lsp-ts-utils") ts_utils.setup({ @@ -128,12 +130,18 @@ require("lspconfig").cssls.setup({ }) -- npm i -g yaml-language-server -require("lspconfig").yamlls.setup({ +require("lspconfig").yamlls.setup( on_attach = lsp_keymaps, capabilities = capabilities, flags = { debounce_text_changes, }, + settings = { + schemas = { + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*" + + } + } }) -- npm i -g bash-language-server @@ -163,7 +171,8 @@ require("lspconfig").pylsp.setup({ }, }) --- ./dot/installs/golang +-- go install golang.org/x/tools/gopls@latest +-- go install golang.org/x/tools/cmd/goimports@latest require("lspconfig").gopls.setup({ cmd = { "gopls", "serve" }, filetypes = { "go", "gomod" }, diff --git a/nvim/lua/odas0r/treesitter.lua b/nvim/lua/odas0r/treesitter.lua index d5eaca2..8186f81 100644 --- a/nvim/lua/odas0r/treesitter.lua +++ b/nvim/lua/odas0r/treesitter.lua @@ -5,14 +5,6 @@ require("nvim-treesitter.configs").setup({ highlight = { enable = true, - - disable = { "vim", "html" }, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = { "markdown" }, }, -- Plugins diff --git a/nvim/plugin/colorscheme.vim b/nvim/plugin/colorscheme.vim index aeebbdd..f1ee954 100644 --- a/nvim/plugin/colorscheme.vim +++ b/nvim/plugin/colorscheme.vim @@ -3,7 +3,7 @@ " Press "K" on when cursor on top of defx let g:tokyonight_style = "night" -let g:tokyonight_italic_functions = 1 +let g:tokyonight_italic_functions = 0 let g:tokyonight_transparent = 1 colorscheme tokyonight diff --git a/nvim/plugin/markdown.vim b/nvim/plugin/markdown.vim index d86b5e6..f85e648 100644 --- a/nvim/plugin/markdown.vim +++ b/nvim/plugin/markdown.vim @@ -1,6 +1,7 @@ " Documentation: vim-markdown " " Press "K" on when cursor on top of vim-markdown +let g:netrw_browsex_viewer = "open" set conceallevel=2 diff --git a/nvim/plugin/zet.vim b/nvim/plugin/zet.vim index 14e2149..c855ce0 100644 --- a/nvim/plugin/zet.vim +++ b/nvim/plugin/zet.vim @@ -5,7 +5,7 @@ nnoremap zp lua require("odas0r.telescope").search_zet_permanent()< augroup zettelkasten_history au! " add to history - au BufWinEnter ~/github.com/zet-cmd/.zet/**/*.md silent !zet history.insert % - au BufWinEnter ~/github.com/zet/fleet/*.md silent !zet history.insert % - au BufWinEnter ~/github.com/zet/permanent/*.md silent !zet history.insert % + au BufWinEnter ~/github.com/odas0r/zet-cmd/.zet/**/*.md silent !zet history.insert % + au BufWinEnter ~/github.com/odas0r/zet/fleet/*.md silent !zet history.insert % + au BufWinEnter ~/github.com/odas0r/zet/permanent/*.md silent !zet history.insert % augroup end diff --git a/nvim/spell/en.utf-8.add b/nvim/spell/en.utf-8.add index b9f9d78..e7b3147 100644 --- a/nvim/spell/en.utf-8.add +++ b/nvim/spell/en.utf-8.add @@ -401,3 +401,10 @@ data-layer vendor-lockin editor-specific RLS +webdev +vite +ssr +alpinejs +twitch.tv +vm +livestreaming diff --git a/nvim/spell/en.utf-8.add.spl b/nvim/spell/en.utf-8.add.spl index 3b5903f83e3c134b9ae1f0f54b17ad628b7f8b5d..f93368f30a42198bf15aa4d6f0df497c3e96420c 100644 GIT binary patch delta 2380 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 DpkLe{ diff --git a/nvim/ultisnips/go.snippets b/nvim/ultisnips/go.snippets index 8deb103..f32094a 100644 --- a/nvim/ultisnips/go.snippets +++ b/nvim/ultisnips/go.snippets @@ -1,119 +1,578 @@ +# SOURCE: https://github.com/fatih/vim-go/blob/master/gosnippets/UltiSnips/go.snippets +# +# ========================================== # Snippets for Go +# ========================================== -priority -50 +priority -0 -snippet /** "Description" A -/** - * $0 - */ +# shorthand variable declaration +snippet : "v := value" +${1} := ${0} endsnippet -# when to abbriviate and when not? -# b doesn't work here, because it ignores whitespace -# optional local name? -snippet /^import/ "Import declaration" r -import ( - "${1:package}" -) +# anonymous function +snippet anon "fn := func() { ... }" +${1:fn} := func() { + ${2:${VISUAL}} +} +${0} endsnippet -snippet /^package/ "Package declaration" r -// Package $1 provides ... -package ${1:main} +# append +snippet ap "append(slice, value)" +append(${1:slice}, ${0:value}) +endsnippet + +# append assignment +snippet ap= "a = append(a, value)" +${1:slice} = append($1, ${0:value}) endsnippet -# Mostly converted from: https://github.com/AlanQuatermain/go-tmbundle -snippet /^cons/ "Constants declaration" r +# break +snippet br "break" +break +endsnippet + +# channel +snippet ch "chan Type" +chan ${0:int} +endsnippet + + +# case +snippet case "case ...:" +case ${1:value}: + ${0:${VISUAL}} +endsnippet + +# constant +snippet con "const XXX Type = ..." +const ${1:NAME} ${2:Type} = ${0:0} +endsnippet + +# constants +snippet cons "const ( ... )" +const ( + + ${1:NAME} ${2:Type} = ${3:value} + ${0} +) +endsnippet + +# constants with iota +snippet iota "const ( ... = iota )" const ( - ${1:constant}${2/(.+)/ /}${2:type} = ${0:value} + ${1:NAME} ${2:Type} = iota + ${0} ) endsnippet -snippet /^con/ "Constant declaration" r -const ${1:name}${2/(.+)/ /}${2:type} = ${0:value} +# continue +snippet cn "continue" +continue endsnippet -snippet iota "Iota constant generator" b -const ( - ${1:constant}${2/(.+)/ /}${2:type} = iota +# default case +snippet default "default: ..." +default: + ${0:${VISUAL}} +endsnippet + +# defer + +snippet df "defer someFunction()" +defer ${1:func}(${2}) +${0} +endsnippet + +snippet def "defer func() { ... }" +defer func() { + ${0:${VISUAL}} +}() +endsnippet + +# defer recover +snippet defr +defer func() { + if err := recover(); err != nil { + ${0:${VISUAL}} + } +}() +endsnippet + +# gpl +snippet gpl +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by + +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see . +* +* Copyright (C) ${1:Author}, `!v strftime("%Y")` +*/ +${0} + +endsnippet + +# import +snippet import "import ( ... )" +import ( + "${1:package}" ) endsnippet -snippet struct "Struct declaration" b -type ${1:Struct} struct { +# full interface snippet +snippet interface "interface I { ... }" +type ${1:Interface} interface { + ${2:/* TODO: add methods */} +} +endsnippet + +# if condition +snippet if "if ... { ... }" +if ${1:condition} { ${0:${VISUAL}} } endsnippet -snippet interface "Interface declaration" b -type ${1:Interface} interface { + +# else snippet +snippet else +else { + ${0:${VISUAL}} +} +endsnippet + +# if inline error +snippet ife "If with inline error" +if err := ${1:condition}; err != nil { + ${0:${VISUAL}} +} +endsnippet + +snippet ew "errors.Wrap" +errors.Wrap(${1:err}, "${2:message}") +endsnippet + +snippet ewf "errors.Wrapf" +errors.Wrapf(${1:err}, "${2:message %v}", ${3:args...}) +endsnippet + +# error snippet +snippet errn "Error return" !b +if err != nil { + return err +} +${0} +endsnippet + +snippet errnw "Error return wrap" !b +if err != nil { + return errors.Wrap(err, "${1:message}") +} +${0} +endsnippet + +snippet errnwf "Error return wrapf" !b +if err != nil { + return errors.Wrapf(err, "${1:message %v}", ${2:args...}) +} +${0} +endsnippet + +# error log snippet +snippet errl "Error with log.Fatal(err)" !b +if err != nil { + log.Fatal(err) +} +${0} +endsnippet + +# error multiple return +snippet errn, "Error return with two return values" !b +if err != nil { + return ${1:nil}, ${2:err} +} +${0} +endsnippet + +snippet errn,w "Error return wrap with two return values" !b +if err != nil { + return nil, errors.Wrap(err, "${1:message}") +} +${0} +endsnippet + +snippet errn,wf "Error return wrapf with two return values" !b +if err != nil { + return nil, errors.Wrapf(err, "${1:message %v}", ${2:args...}) +} +${0} +endsnippet + +# error panic +snippet errp "Error panic" !b +if err != nil { + panic(${1}) +} +${0} +endsnippet + +# error test +snippet errt "Error test fatal " !b +if err != nil { + t.Fatal(err) +} +${0} +endsnippet + + +# error handle +snippet errh "Error handle and return" !b +if err != nil { + ${1} + return +} +${0} +endsnippet + +# json field tag +snippet json "\`json:key\`" +\`json:"${1:`!v go#util#snippetcase(matchstr(getline("."), '\w\+'))`}"\` +endsnippet + +# yaml field tag +snippet yaml "\`yaml:key\`" +\`yaml:"${1:`!v go#util#snippetcase(matchstr(getline("."), '\w\+'))`}"\` +endsnippet + +# fallthrough +snippet ft "fallthrough" +fallthrough +endsnippet + +# for loop +snippet for "for ... { ... }" +for ${1} { ${0:${VISUAL}} } endsnippet -snippet if "If statement" b -if ${1:condition}${1/(.+)/ /}{ +# for integer loop +snippet fori "for 0..N-1 { ... }" +for ${1:i} := 0; $1 < ${2:N}; $1++ { ${0:${VISUAL}} + } endsnippet -snippet switch "Switch statement" b -switch ${1:expression}${1/(.+)/ /}{ -case$0 +# for range loop +snippet forr "for k, v := range items { ... }" + +for ${2:k}, ${3:v} := range ${1} { + ${0:${VISUAL}} +} +endsnippet + +snippet forsel "for select" +for { + select { + case ${2:${1:result} := }<- ${3:channel}: + ${0} + } +} +endsnippet + +snippet selc "select case" !b +case ${1:${2:var} := }<-${3:channel}: + ${0} + +endsnippet + +# function +snippet func "func Function(...) [error] { ... }" +func ${1:name}(${2:params})${3/(.+)/ /}`!p opening_par(snip, 3)`$3`!p closing_par(snip, 3)` { + ${0:${VISUAL}} +} +endsnippet + +# Fmt Printf debug +snippet ff "fmt.Printf(...)" +fmt.Printf("$1 = %+v\n", ${1:${VISUAL}}) +endsnippet + +# Fmt Printf debug with hash +snippet ffh "fmt.Printf(#...) hash" +fmt.Printf("$1 = %#v\n", ${1:${VISUAL}}) +endsnippet + +# Fmt Println debug +snippet fn "fmt.Println(...)" +fmt.Println("${1:${VISUAL}}") +endsnippet + +# Fmt Errorf debug +snippet fe "fmt.Errorf(...)" +fmt.Errorf("${1:${VISUAL}}") +endsnippet + +# Fmt Errorf wrap +snippet few "fmt.Errorf(%w, err)" +fmt.Errorf("${1:message}: %w", ${2:${VISUAL:err}}) +endsnippet + +# Fmt Errorf wrap and return +snippet errnfw "Error return fmt.Errorf(%w, err)" !b +if ${1:${VISUAL:err}} != nil { + return fmt.Errorf("${2:message}: %w", $1) } endsnippet -# functions -snippet /^main/ "Main function" r +# log printf +snippet lf "log.Printf(...)" +log.Printf("${1:${VISUAL}} = %+v\n", $1) +endsnippet + +# log println +snippet ln "log.Println(...)" +log.Println("${1:${VISUAL}}") +endsnippet + +# make +snippet make "make(Type, size)" +make(${1:[]string}, ${2:0})${0} +endsnippet + +# map +snippet map "map[Type]Type" +map[${1:string}]${0:int} +endsnippet + +# main() +snippet main "func main() { ... }" func main() { ${0:${VISUAL}} } endsnippet -snippet /^meth/ "Method" r -func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}${5:type} { +# method +snippet meth "func (self Type) Method(...) [error] { ... }" +func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}`!p opening_par(snip, 5)`$5`!p closing_par(snip, 5)` { ${0:${VISUAL}} } endsnippet -snippet func "Function" b -func ${1:name}(${2:params})${3/(.+)/ /}${3:type} { +# ok +snippet ok "if !ok { ... }" +if !ok { ${0:${VISUAL}} } endsnippet -snippet funch "HTTP handler" b -func ${1:handler}(${2:w} http.ResponseWriter, ${3:r} *http.Request) { +# package +snippet package "package ..." +// Package $1 provides ${2:...} +package ${1:main} +${0} +endsnippet + +# panic +snippet pn "panic()" +panic("${0:msg}") +endsnippet + +# return +snippet rt "return" +return ${0:${VISUAL}} +endsnippet + +# select +snippet select "select { case a := <-chan: ... }" +select { +case ${1:v1} := <-${2:chan1}: + ${0} +} +endsnippet + +# struct +snippet st "type T struct { ... }" +type ${1:Type} struct { + ${0} +} +endsnippet + + +# switch +snippet switch "switch x { ... }" +switch ${1:var} { + +case ${2:value1}: + ${0} +} +endsnippet + +snippet tswitch "type switch x { ... }" +switch ${2:$1 := }${1:v}.(type) { + ${0} +} +endsnippet + +# sprintf +snippet sp "fmt.Sprintf(...)" +fmt.Sprintf("%${1:s}", ${2:var}) +endsnippet + +# goroutine named function +snippet go "go someFunc(...)" +go ${1:funcName}(${0}) +endsnippet + +# goroutine anonymous function +snippet gof "go func() { ... }()" +go func() { + ${1:${VISUAL}} +}() +${0} +endsnippet + +# test function +snippet test "func TestXYZ(t *testing.T) { ... }" +func Test${1:Function}(t *testing.T) { ${0:${VISUAL}} } endsnippet -# types and variables -snippet map "Map type" b -map[${1:keytype}]${2:valtype} +# test t.Run +snippet tr "t.Run(XYZ, func(t *testing.T){ ... })" +t.Run("${0}", func(t *testing.T){ + +}) endsnippet -snippet : "Variable declaration :=" b -${1:name} := ${0:value} +# test table snippet +snippet tt +var tests = []struct { + name string + expected string + given string +}{ + {"${1}", "${2}", "${3}",}, +} +for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T){ + actual := ${0:${VISUAL}}(tt.given) + if actual != tt.expected { + t.Errorf("$0(%s): expected %s, actual %s", tt.given, tt.expected, actual) + } + + }) +} endsnippet -snippet var "Variable declaration" b -var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}} + +snippet hf "http.HandlerFunc" +func ${1:handler}(w http.ResponseWriter, r *http.Request) { + ${0:fmt.Fprintf(w, "hello world")} +} endsnippet -snippet vars "Variables declaration" b -var ( - ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} } -) + +snippet hhf "mux.HandleFunc" !b +${1:http}.HandleFunc("${2:/}", func(w http.ResponseWriter, r *http.Request) { + ${0:fmt.Fprintf(w, "hello world")} +}) endsnippet -snippet json "JSON field" -\`json:"${1:displayName}"\` +# quick test server +snippet tsrv "httptest.NewServer" +ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, ${1:`response`}) +})) +defer ts.Close() + +${0:someUrl} = ts.URL endsnippet -# error handling -snippet err "Basic error handling" b +# test error handling +snippet ter "if err != nil { t.Errorf(...) }" if err != nil { - log.${1:Fatal}(err) + t.Errorf("${0:message}") } endsnippet + +# test fatal error +snippet terf "if err != nil { t.Fatalf(...) }" +if err != nil { + t.Fatalf("${0:message}") +} +endsnippet + +snippet example "func ExampleXYZ() { ... }" +func Example${1:Method}() { + ${0:${VISUAL}} + // Output: +} +endsnippet + +snippet benchmark "func BenchmarkXYZ(b *testing.B) { ... }" +func Benchmark${1:Method}(b *testing.B) { + for i := 0; i < b.N; i++ { + ${0:${VISUAL}} + } +} + +endsnippet + +# variable declaration +snippet var "var x Type [= ...]" +var ${1:x} ${2:Type}${3: = ${0:value}} +endsnippet + +# variables declaration +snippet vars "var ( ... )" +var ( + ${1:x} ${2:Type}${3: = ${0:value}} +) + +endsnippet + +# equals fails the test if exp is not equal to act. +snippet eq "equals: test two identifiers with DeepEqual" +if !reflect.DeepEqual(${1:expected}, ${2:actual}) { + _, file, line, _ := runtime.Caller(0) + fmt.Printf("%s:%d:\n\n\texp: %#v\n\n\tgot: %#v\n\n", filepath.Base(file), line, $1, $2) + t.FailNow() +} +endsnippet + +global !p +import re +# Automatically wrap return types with parentheses +def return_values(s): + # remove everything wrapped in parentheses + s = re.sub("\(.*?\)|\([^)]*$", "", s) + return len(s.split(",")) +def opening_par(snip, pos): + if return_values(t[pos]) > 1 and not t[pos].startswith("("): + snip.rv = "(" + else: + snip.rv = "" +def closing_par(snip, pos): + if return_values(t[pos]) > 1: + snip.rv = ")" + else: + snip.rv = "" +endglobal + +# vim:ft=snippets:1 diff --git a/.psqlrc b/psqlrc similarity index 100% rename from .psqlrc rename to psqlrc diff --git a/scripts/lzd b/scripts/lzd new file mode 100755 index 0000000..e89866e --- /dev/null +++ b/scripts/lzd @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +if [[ ! -x "$(command -v lazydocker)" ]]; then + echo "You need to install lazygit" + exit 1 +fi + +popup lazydocker "$@" diff --git a/scripts/lg b/scripts/lzg similarity index 100% rename from scripts/lg rename to scripts/lzg diff --git a/scripts/tmuxin b/scripts/tmuxin index 250dd6c..41eb64b 100755 --- a/scripts/tmuxin +++ b/scripts/tmuxin @@ -2,21 +2,12 @@ set -e -# Tags Explanation -# -c: path of the session -# -s: session name -# -n: window name -# -d: "detach" -# send-keys: C-m -> Enter Key - -# ===================== -# wallstreeters session -# ===================== -# -# manage the project wallstreeters +# ================================== +# Wallstreeters +# ================================== session="wallstreeters" -workspace="$(markpath wall-client)" +workspace="$HOME/github.com/wallstreeters/client" if tmux has-session -t $session &>/dev/null; then tmux kill-session -t "$session" @@ -30,9 +21,13 @@ tmux send-keys -t "${session}:${window}" "nvim -c 'Telescope git_files'" C-m window=2 tmux new-window -t "${session}:${window}" -n "server" -c "$workspace" -tmux send-keys -t "${session}:${window}" "yarn next:dev" C-m +tmux send-keys -t "${session}:${window}" "yarn docker:start && yarn psql" C-m tmux split-window -h -t "${session}:${window}" -c "$workspace" -tmux send-keys -t "${session}:${window}.2" "yarn psql" C-m +tmux send-keys -t "${session}:${window}.2" "yarn next:dev" C-m + +window=3 +tmux new-window -t "${session}:${window}" -n "docker" -c "$workspace" +tmux send-keys -t "${session}:${window}" "lazydocker" C-m tmux select-window -t :+1 diff --git a/setup b/setup index cf80154..deb7407 100755 --- a/setup +++ b/setup @@ -8,14 +8,9 @@ ln -sf "$HOME/dot/scripts" "$HOME/.local/bin/scripts" ln -sf "$HOME/dot/bashrc" "$HOME/.bashrc" ln -sf "$HOME/dot/inputrc" "$HOME/.inputrc" +ln -sf "$HOME/dot/psqlrc" "$HOME/.psqlrc" ln -sf "$HOME/dot/bash" "$HOME/.bash" -# MacOS shit -if [[ $OSTYPE == "darwin"* ]]; then - ln -sf "karabiner.json" "$HOME/.config/karabiner/karabiner.json" - ln -sf "tabnine_config.json" "/Users/odas0r/Library/Preferences/TabNine/tabnine_config.json" -fi - printf "Executing all setup scripts ✨...\n" readarray -d '' folders < <( diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 239ca57..6c5f1d8 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -1,6 +1,6 @@ setw -g aggressive-resize on -set -sg escape-time 0 +set -g escape-time 10 set -g repeat-time 200 set -g history-limit 50001 @@ -25,8 +25,8 @@ set -g status-left '' set -g status-left-length 0 set -g status-right '' set -g status-right-length 0 -set -g status-right '%a %Y-%m-%d %H:%M' -set -g status-right-length 30 +set -g status-right '#(date)' +set -g status-right-length 27 # sync clipboard set -g set-clipboard on @@ -66,6 +66,7 @@ bind -r c new-window -c "#{pane_current_path}" # set key-mode to vi set-window-option -g mode-keys vi + # vi like copy paste behaviour bind -r v copy-mode bind-key -T copy-mode-vi 'v' send -X begin-selection From 27404963fa2e04908fa77d8abe34c7f28cadcd1e Mon Sep 17 00:00:00 2001 From: odas0R Date: Mon, 4 Apr 2022 13:42:44 +0100 Subject: [PATCH 06/22] commit --- nvim/lua/odas0r/formatter.lua | 8 +++++++- nvim/lua/odas0r/lsp.lua | 11 +++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/nvim/lua/odas0r/formatter.lua b/nvim/lua/odas0r/formatter.lua index 4875581..d56d352 100644 --- a/nvim/lua/odas0r/formatter.lua +++ b/nvim/lua/odas0r/formatter.lua @@ -14,7 +14,13 @@ local formatterConfig = { function() return { exe = "stylua", - args = { "--indent-type", "Spaces", "--indent-width", 2 }, + args = { + "--indent-type", + "Spaces", + "--indent-width", + 2, + vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)), + }, stdin = false, } end, diff --git a/nvim/lua/odas0r/lsp.lua b/nvim/lua/odas0r/lsp.lua index 28f11b7..6edf5bb 100644 --- a/nvim/lua/odas0r/lsp.lua +++ b/nvim/lua/odas0r/lsp.lua @@ -24,7 +24,7 @@ end local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) -local lsp_util = require("lspconfig").util; +local lsp_util = require("lspconfig").util local debounce_text_changes = 150 @@ -130,7 +130,7 @@ require("lspconfig").cssls.setup({ }) -- npm i -g yaml-language-server -require("lspconfig").yamlls.setup( +require("lspconfig").yamlls.setup({ on_attach = lsp_keymaps, capabilities = capabilities, flags = { @@ -138,10 +138,9 @@ require("lspconfig").yamlls.setup( }, settings = { schemas = { - ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*" - - } - } + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", + }, + }, }) -- npm i -g bash-language-server From efb4acd1675b5f33ea40026216d3d760112ccc43 Mon Sep 17 00:00:00 2001 From: odas0R Date: Thu, 14 Apr 2022 12:43:11 +0100 Subject: [PATCH 07/22] commit --- bash/aliases.sh | 4 +++- git/gitconfig | 7 ------- install/pgFormatter | 22 +------------------- lazygit/config.yml | 2 +- nvim/init.vim | 24 +++++----------------- nvim/lua/odas0r/cmp.lua | 10 --------- nvim/lua/odas0r/formatter.lua | 24 +++++++++++++++++----- nvim/lua/odas0r/init.lua | 1 + nvim/lua/odas0r/lsp.lua | 9 ++++++++ nvim/lua/odas0r/nvim-terminal.lua | 11 ++++++++++ nvim/lua/odas0r/telescope.lua | 2 +- nvim/lua/odas0r/treesitter.lua | 2 +- nvim/plugin/{yank.vim => clipboard.vim} | 8 ++++++-- nvim/plugin/defx.vim | 19 +++++++++++++++-- nvim/plugin/markdown.vim | 26 ++++++++++++++++++++++-- nvim/plugin/terminal.vim | 6 +++--- nvim/plugin/zet.vim | 1 + nvim/spell/en.utf-8.add | 9 ++++++++ nvim/spell/en.utf-8.add.spl | Bin 5071 -> 5162 bytes nvim/ultisnips/sql.snippets | 2 +- scripts/open | 8 ++++++++ scripts/pgfmt | 1 + scripts/xdg-open | 6 ++++++ tmux/tmux.conf | 3 +-- 24 files changed, 129 insertions(+), 78 deletions(-) create mode 100644 nvim/lua/odas0r/nvim-terminal.lua rename nvim/plugin/{yank.vim => clipboard.vim} (64%) create mode 100755 scripts/open create mode 100755 scripts/xdg-open diff --git a/bash/aliases.sh b/bash/aliases.sh index 1baef53..d6cb6f4 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -6,6 +6,8 @@ alias ls="ls --format=single-column --classify --color --group-directories-first alias la="ls -la" alias sb="source ~/.bashrc" +alias hosts="sudoedit /etc/hosts" + # Use nvr to avoid nesting nvim in Terminal buffers. alias nvim="nvim-nvr" @@ -24,5 +26,5 @@ repos() { fzf-tmux -p 40% --multi --prompt="Your repositories > " ) - cd "$repo" + cd "$repo" || return } diff --git a/git/gitconfig b/git/gitconfig index e77a41d..a0d55b2 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -19,10 +19,3 @@ cmd = nvr -s -d $LOCAL $BASE $REMOTE $MERGED -c 'wincmd J | wincmd =' prompt = false keepBackup = false - -; [merge] -; tool = "nvim -d" -; conflictstyle = diff3 -; [mergetool] -; prompt = false -; keepBackup = false diff --git a/install/pgFormatter b/install/pgFormatter index 63d40ca..93b61da 100755 --- a/install/pgFormatter +++ b/install/pgFormatter @@ -2,24 +2,4 @@ set -e -# install Perl CGI module -sudo apt-get install libcgi-pm-perl -y - -# make tmp dir for installation -mkdir -p /tmp/pgFormatter -cd /tmp/pgFormatter - -owner="darold" -repo="pgFormatter" - -version="$(curl -s "https://api.github.com/repos/${owner}/${repo}/releases/latest" | jq -r '.tag_name')" -downloadFile="${version}.tar.gz" - -# download the latest release -wget "https://github.com/${owner}/${repo}/archive/refs/tags/${downloadFile}" - -# tar the file -tar -xzf "$downloadFile" -cd "pgFormatter-${version//v/}" -perl Makefile.PL -make && sudo make install +echo "type pg_format to see the installer command" diff --git a/lazygit/config.yml b/lazygit/config.yml index 0576268..bfbc8b5 100644 --- a/lazygit/config.yml +++ b/lazygit/config.yml @@ -52,7 +52,7 @@ git: # one of always, never, when-maximised # this determines whether the git graph is rendered in the commits panel showGraph: 'when-maximised' - skipHookPrefix: 'wip():' + skipHookPrefix: 'WIP:' autoFetch: true branchLogCmd: 'git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --' allBranchesLogCmd: 'git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium' diff --git a/nvim/init.vim b/nvim/init.vim index 3b37434..9fb10da 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -1,4 +1,4 @@ -set tw=72 fo=cq wm=0 " no automatic wrapping, rewrapping will wrap to 72 +set tw=79 fo=cq wm=0 " no automatic wrapping, rewrapping will wrap to 79 set tabstop=2 set softtabstop=-1 @@ -24,7 +24,6 @@ set nofixendofline set foldmethod=manual set noshowmatch -match ErrorMsg '\s\+$' set shortmess=aoOtTI set hidden @@ -35,7 +34,7 @@ set updatetime=100 set hlsearch set incsearch set linebreak -set nowrap " wrap is for psychopaths +set nowrap " more risky, but cleaner set nobackup @@ -53,9 +52,6 @@ set foldmethod=manual set spelllang+=pt_pt set encoding=utf-8 -" set the cursor fat on insert -" set guicursor=i:block - " Return to last edit position when opening files au BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | @@ -85,7 +81,6 @@ set wildignore+=**/.supabase/* " augroup custom_settings au! - au FileType markdown setl conceallevel=2 spell norelativenumber tw=72 foldlevel=99 au FileType text setl conceallevel=2 spell norelativenumber tw=72 au BufRead *.env* setl ft=config augroup end @@ -114,7 +109,6 @@ call plug#begin() Plug 'folke/tokyonight.nvim', { 'branch': 'main' } Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'windwp/nvim-ts-autotag' -Plug 'nvim-treesitter/nvim-treesitter-refactor' " status line Plug 'nvim-lualine/lualine.nvim' @@ -127,11 +121,13 @@ Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } Plug 'numToStr/Comment.nvim' Plug 'JoosepAlviste/nvim-ts-context-commentstring' Plug 'ThePrimeagen/harpoon' -Plug 'caenrique/nvim-toggle-terminal' +" Plug 'caenrique/nvim-toggle-terminal' +Plug 's1n7ax/nvim-terminal' Plug 'mhinz/vim-signify' " newtr replacement because newtr sucks Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } +Plug 'kristijanhusak/defx-git' " database " fork of https://github.com/tpope/vim-dadbod (I believe this is faster) @@ -199,16 +195,6 @@ let g:db="postgres://postgres:postgres@localhost:5432/postgres" let g:vim_dadbod_completion_mark = 'SQL' let g:completion_matching_ignore_case = 1 -" -" Folding -" -let g:markdown_folding = 1 - -augroup remember_folds - autocmd! - autocmd BufWinLeave *.md mkview - autocmd BufWinEnter *.md silent! loadview -augroup END lua << EOF -- import all configs diff --git a/nvim/lua/odas0r/cmp.lua b/nvim/lua/odas0r/cmp.lua index cf17b7a..5e1c01a 100644 --- a/nvim/lua/odas0r/cmp.lua +++ b/nvim/lua/odas0r/cmp.lua @@ -59,12 +59,8 @@ cmp.setup({ "s", }), }, - sources = cmp.config.sources({ - { name = "gh_issues" }, - { name = "nvim_lua" }, - { name = "nvim_lsp" }, { name = "path" }, { @@ -74,17 +70,13 @@ cmp.setup({ }, }, { name = "vim-dadbod-completion" }, - - -- { name = "cmp_tabnine" }, { name = "ultisnips" }, }), - snippet = { expand = function(args) vim.fn["UltiSnips#Anon"](args.body) end, }, - formatting = { format = lspkind.cmp_format({ with_text = true, @@ -92,9 +84,7 @@ cmp.setup({ nvim_lua = "[Lua]", nvim_lsp = "[Lsp]", path = "[Path]", - -- cmp_tabnine = "[TN]", ["vim-dadbod-completion"] = "[Sql]", - gh_issues = "[Issue]", ultisnips = "[Snip]", buffer = "[Buffer]", }, diff --git a/nvim/lua/odas0r/formatter.lua b/nvim/lua/odas0r/formatter.lua index d56d352..0ffb53e 100644 --- a/nvim/lua/odas0r/formatter.lua +++ b/nvim/lua/odas0r/formatter.lua @@ -9,6 +9,14 @@ local prettierConfig = function() } end +local eslintConfig = function() + return { + exe = "eslint", + args = { "--fix", vim.fn.shellescape(vim.api.nvim_buf_get_name(0)) }, + stdin = true, + } +end + local formatterConfig = { lua = { function() @@ -21,7 +29,7 @@ local formatterConfig = { 2, vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)), }, - stdin = false, + stdin = true, } end, }, @@ -84,15 +92,21 @@ local formatterConfig = { }, } +local commonPE = { + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", +} +for _, ft in ipairs(commonPE) do + formatterConfig[ft] = { prettierConfig, eslintConfig } +end + local commonFT = { "css", "scss", "html", "java", - "javascript", - "javascriptreact", - "typescript", - "typescriptreact", "markdown", "markdown.mdx", "yaml", diff --git a/nvim/lua/odas0r/init.lua b/nvim/lua/odas0r/init.lua index 1c800b7..77366df 100644 --- a/nvim/lua/odas0r/init.lua +++ b/nvim/lua/odas0r/init.lua @@ -9,3 +9,4 @@ require("odas0r.comment") require("odas0r.treesitter") require("odas0r.telescope") require("odas0r.harpoon") +require("odas0r.nvim-terminal") diff --git a/nvim/lua/odas0r/lsp.lua b/nvim/lua/odas0r/lsp.lua index 6edf5bb..88cdab6 100644 --- a/nvim/lua/odas0r/lsp.lua +++ b/nvim/lua/odas0r/lsp.lua @@ -33,6 +33,15 @@ require("lspconfig").tsserver.setup({ -- Needed for inlayHints. Merge this table with your settings or copy -- it from the source if you want to add your own init_options. init_options = require("nvim-lsp-ts-utils").init_options, + filetypes = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + -- "markdown" + }, root_dir = lsp_util.root_pattern("package.json"), on_attach = function(client, bufnr) local ts_utils = require("nvim-lsp-ts-utils") diff --git a/nvim/lua/odas0r/nvim-terminal.lua b/nvim/lua/odas0r/nvim-terminal.lua new file mode 100644 index 0000000..d6d3d8b --- /dev/null +++ b/nvim/lua/odas0r/nvim-terminal.lua @@ -0,0 +1,11 @@ +local Terminal = require('nvim-terminal.terminal') +local Window = require('nvim-terminal.window') + +local window = Window:new({ + position = 'botright', + split = 'sp', + width = 100, + height = 30 +}) + +terminal = Terminal:new(window) diff --git a/nvim/lua/odas0r/telescope.lua b/nvim/lua/odas0r/telescope.lua index c6535b9..3043a4d 100644 --- a/nvim/lua/odas0r/telescope.lua +++ b/nvim/lua/odas0r/telescope.lua @@ -34,7 +34,7 @@ require("telescope").setup({ extensions = { fzf = { fuzzy = true, - case_mode = "smart_case", + -- case_mode = "smart_case", }, }, }) diff --git a/nvim/lua/odas0r/treesitter.lua b/nvim/lua/odas0r/treesitter.lua index 8186f81..78e56eb 100644 --- a/nvim/lua/odas0r/treesitter.lua +++ b/nvim/lua/odas0r/treesitter.lua @@ -1,5 +1,5 @@ require("nvim-treesitter.configs").setup({ - ensure_installed = "maintained", + ensure_installed = "all", indent = { enable = true }, diff --git a/nvim/plugin/yank.vim b/nvim/plugin/clipboard.vim similarity index 64% rename from nvim/plugin/yank.vim rename to nvim/plugin/clipboard.vim index 885423e..6add21d 100644 --- a/nvim/plugin/yank.vim +++ b/nvim/plugin/clipboard.vim @@ -12,6 +12,10 @@ let g:oscyank_term = 'default' let g:clipboard = { \ 'name': 'osc53', - \ 'copy': {'+': {lines, regtype -> OSCYankString(join(lines, "\n"))}}, - \ 'paste': {'+': {-> [split(getreg(''), '\n'), getregtype('')]}}, + \ 'copy': { + \ '+': {lines, regtype -> OSCYankString(join(lines, "\n"))}, + \ }, + \ 'paste': { + \ '+': {-> [split(getreg(''), '\n'), getregtype('')]} + \ }, \ } diff --git a/nvim/plugin/defx.vim b/nvim/plugin/defx.vim index 30dbf59..92bca94 100644 --- a/nvim/plugin/defx.vim +++ b/nvim/plugin/defx.vim @@ -2,8 +2,13 @@ " " Press "K" on when cursor on top of defx -nnoremap \ :Defx -search=`expand('%:p')` `expand('%:p:h')` + +nnoremap \ Defx -columns=mark:indent:icon:space:git:filename -search=`expand('%:p')` `expand('%:p:h')` + function! DefxMappings() + " local options + setlocal cursorline + " open a file with left mouse click nnoremap <2-LeftMouse> defx#do_action('open_tree', 'toggle') nnoremap c @@ -41,7 +46,7 @@ function! DefxMappings() \ defx#do_action('cd', ['..']) nnoremap q \ defx#do_action('quit') - nnoremap + nnoremap \ defx#do_action('toggle_select') . 'j' nnoremap \ defx#do_action('toggle_select_all') @@ -69,3 +74,13 @@ function! s:browse_check(path) abort augroup END execute 'Defx' a:path endfunction + +" Defx *git* indicators +call defx#custom#column('git', 'raw_mode', 1) + +call defx#custom#column('git', 'column_length', 1) +call defx#custom#column('git', 'max_indicator_width', 0) + +" I want to update defx status automatically when changing file. +autocmd BufWritePost * call defx#redraw() + diff --git a/nvim/plugin/markdown.vim b/nvim/plugin/markdown.vim index f85e648..39d81e7 100644 --- a/nvim/plugin/markdown.vim +++ b/nvim/plugin/markdown.vim @@ -1,9 +1,8 @@ " Documentation: vim-markdown " " Press "K" on when cursor on top of vim-markdown -let g:netrw_browsex_viewer = "open" -set conceallevel=2 +let g:netrw_browsex_viewer = "open" let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_conceal_code_blocks = 1 @@ -11,3 +10,26 @@ let g:vim_markdown_new_list_item_indent = 2 let g:vim_markdown_no_extensions_in_markdown = 0 let g:vim_markdown_autowrite = 1 let g:vim_markdown_edit_url_in = 'current' + +" +" Markdown Custom Settings +" +augroup markdown_custom_settings + autocmd! + autocmd FileType markdown setlocal + \ conceallevel=2 + \ spell nonumber norelativenumber + \ tw=80 foldlevel=99 + \ wrap linebreak +augroup END + +" +" Remmember Folding +" +let g:markdown_folding = 1 + +augroup remember_folds + autocmd! + autocmd BufWinLeave *.md mkview + autocmd BufWinEnter *.md silent! loadview +augroup END diff --git a/nvim/plugin/terminal.vim b/nvim/plugin/terminal.vim index 4210c0d..8be007a 100644 --- a/nvim/plugin/terminal.vim +++ b/nvim/plugin/terminal.vim @@ -2,8 +2,8 @@ " " Press "K" on when cursor on top of telescope -nnoremap t :ToggleTerminal -tnoremap t :ToggleTerminal +nnoremap t lua terminal:toggle() +tnoremap t lua terminal:toggle() tnoremap (&filetype == "fzf") ? "" : "" tnoremap @@ -11,7 +11,7 @@ tnoremap augroup terminal_settings autocmd! - autocmd TermOpen * startinsert + autocmd TermOpen * startinsert | setlocal nonumber norelativenumber autocmd TermLeave * stopinsert " Ignore various filetypes as those will close terminal automatically diff --git a/nvim/plugin/zet.vim b/nvim/plugin/zet.vim index c855ce0..9150181 100644 --- a/nvim/plugin/zet.vim +++ b/nvim/plugin/zet.vim @@ -8,4 +8,5 @@ augroup zettelkasten_history au BufWinEnter ~/github.com/odas0r/zet-cmd/.zet/**/*.md silent !zet history.insert % au BufWinEnter ~/github.com/odas0r/zet/fleet/*.md silent !zet history.insert % au BufWinEnter ~/github.com/odas0r/zet/permanent/*.md silent !zet history.insert % + au BufWinEnter ~/github.com/odas0r/zet/permanent/*.md silent !zet history.insert % augroup end diff --git a/nvim/spell/en.utf-8.add b/nvim/spell/en.utf-8.add index e7b3147..07840eb 100644 --- a/nvim/spell/en.utf-8.add +++ b/nvim/spell/en.utf-8.add @@ -408,3 +408,12 @@ alpinejs twitch.tv vm livestreaming +starter-kit +ens33 +mobiledata +postgresql +PostgreSQL +cli +Alacritty +alacritty +xstate diff --git a/nvim/spell/en.utf-8.add.spl b/nvim/spell/en.utf-8.add.spl index f93368f30a42198bf15aa4d6f0df497c3e96420c..9b3277498cf814bf315835e0a65b93975b1b70e9 100644 GIT binary patch literal 5162 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 Date: Thu, 14 Apr 2022 14:31:19 +0100 Subject: [PATCH 08/22] added zet utilities to telescope --- nvim/lua/odas0r/formatter.lua | 2 +- nvim/lua/odas0r/telescope.lua | 66 ++++++++++++++++++++++++++++++----- nvim/plugin/telescope.vim | 2 ++ 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/nvim/lua/odas0r/formatter.lua b/nvim/lua/odas0r/formatter.lua index 0ffb53e..6da594c 100644 --- a/nvim/lua/odas0r/formatter.lua +++ b/nvim/lua/odas0r/formatter.lua @@ -29,7 +29,7 @@ local formatterConfig = { 2, vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)), }, - stdin = true, + stdin = false, } end, }, diff --git a/nvim/lua/odas0r/telescope.lua b/nvim/lua/odas0r/telescope.lua index 3043a4d..4ae1ada 100644 --- a/nvim/lua/odas0r/telescope.lua +++ b/nvim/lua/odas0r/telescope.lua @@ -49,18 +49,68 @@ M.search_dotfiles = function() }) end -M.search_zet_fleet = function() - require("telescope.builtin").live_grep({ - prompt_title = "Searching Zettelkasten...", - cwd = "~/github.com/zet/fleet", +M.search_zet_fleet = function(tags) + if #tags == 0 then + require("telescope.builtin").live_grep({ + prompt_title = "[Fleet]", + cwd = "~/github.com/odas0r/zet/fleet", + hidden = true, + }) + end + + local search = "" + + for index, tag in ipairs(tags) do + if index < #tags then + search = search .. tag .. "|" + else + search = search .. tag + end + end + + -- create the regex expression + search = "(" .. search .. ")" + + -- Search on zettel + require("telescope.builtin").grep_string({ + search = search, + prompt_title = "[Fleet]: " .. search, + cwd = "~/github.com/odas0r/zet/fleet", + use_regex = true, + word_match = "-w", hidden = true, }) end -M.search_zet_permanent = function() - require("telescope.builtin").live_grep({ - prompt_title = "Searching Zettelkasten...", - cwd = "~/github.com/zet/permanent", +M.search_zet_permanent = function(tags) + if #tags == 0 then + require("telescope.builtin").live_grep({ + prompt_title = "[Permanent]", + cwd = "~/github.com/odas0r/zet/permanent", + hidden = true, + }) + end + + local search = "" + + for index, tag in ipairs(tags) do + if index < #tags then + search = search .. tag .. "|" + else + search = search .. tag + end + end + + -- create the regex expression + search = "(" .. search .. ")" + + -- Search on zettel + require("telescope.builtin").grep_string({ + search = search, + prompt_title = "[Permanent]: " .. search, + cwd = "~/github.com/odas0r/zet/permanent", + use_regex = true, + word_match = "-w", hidden = true, }) end diff --git a/nvim/plugin/telescope.vim b/nvim/plugin/telescope.vim index edf43e4..fe3b989 100644 --- a/nvim/plugin/telescope.vim +++ b/nvim/plugin/telescope.vim @@ -3,7 +3,9 @@ " Press "K" on when cursor on top of telescope nnoremap Telescope git_files +nnoremap Telescope grep_string nnoremap Telescope live_grep +nnoremap Telescope man_pages nnoremap b Telescope buffers " custom telescope built-ins From c90377a8802710d2f772b62d21a2cf7b086810a3 Mon Sep 17 00:00:00 2001 From: odas0R Date: Mon, 18 Apr 2022 21:23:00 +0100 Subject: [PATCH 09/22] better `:term` ux, and more improvements --- nvim/init.vim | 2 -- nvim/lua/odas0r/formatter.lua | 23 ++++----------------- nvim/lua/odas0r/lsp.lua | 33 +++++++++++++++++++----------- nvim/lua/odas0r/telescope.lua | 34 +++++++++++++++++++++++++++++-- nvim/plugin/defx.vim | 2 +- nvim/plugin/formatter.vim | 6 ++++++ nvim/plugin/terminal.vim | 2 ++ nvim/spell/en.utf-8.add | 5 +++++ nvim/spell/en.utf-8.add.spl | Bin 5162 -> 5195 bytes nvim/ultisnips/markdown.snippets | 10 ++++----- 10 files changed, 76 insertions(+), 41 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index 9fb10da..7990a51 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -121,7 +121,6 @@ Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } Plug 'numToStr/Comment.nvim' Plug 'JoosepAlviste/nvim-ts-context-commentstring' Plug 'ThePrimeagen/harpoon' -" Plug 'caenrique/nvim-toggle-terminal' Plug 's1n7ax/nvim-terminal' Plug 'mhinz/vim-signify' @@ -195,7 +194,6 @@ let g:db="postgres://postgres:postgres@localhost:5432/postgres" let g:vim_dadbod_completion_mark = 'SQL' let g:completion_matching_ignore_case = 1 - lua << EOF -- import all configs require("odas0r") diff --git a/nvim/lua/odas0r/formatter.lua b/nvim/lua/odas0r/formatter.lua index 6da594c..6a5dc0b 100644 --- a/nvim/lua/odas0r/formatter.lua +++ b/nvim/lua/odas0r/formatter.lua @@ -9,14 +9,6 @@ local prettierConfig = function() } end -local eslintConfig = function() - return { - exe = "eslint", - args = { "--fix", vim.fn.shellescape(vim.api.nvim_buf_get_name(0)) }, - stdin = true, - } -end - local formatterConfig = { lua = { function() @@ -27,7 +19,6 @@ local formatterConfig = { "Spaces", "--indent-width", 2, - vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)), }, stdin = false, } @@ -92,16 +83,6 @@ local formatterConfig = { }, } -local commonPE = { - "javascript", - "javascriptreact", - "typescript", - "typescriptreact", -} -for _, ft in ipairs(commonPE) do - formatterConfig[ft] = { prettierConfig, eslintConfig } -end - local commonFT = { "css", "scss", @@ -112,6 +93,10 @@ local commonFT = { "yaml", "xml", "svg", + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", } for _, ft in ipairs(commonFT) do formatterConfig[ft] = { prettierConfig } diff --git a/nvim/lua/odas0r/lsp.lua b/nvim/lua/odas0r/lsp.lua index 88cdab6..e523c63 100644 --- a/nvim/lua/odas0r/lsp.lua +++ b/nvim/lua/odas0r/lsp.lua @@ -33,16 +33,6 @@ require("lspconfig").tsserver.setup({ -- Needed for inlayHints. Merge this table with your settings or copy -- it from the source if you want to add your own init_options. init_options = require("nvim-lsp-ts-utils").init_options, - filetypes = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - -- "markdown" - }, - root_dir = lsp_util.root_pattern("package.json"), on_attach = function(client, bufnr) local ts_utils = require("nvim-lsp-ts-utils") ts_utils.setup({ @@ -68,9 +58,25 @@ require("lspconfig").tsserver.setup({ filter_out_diagnostics_by_code = {}, -- inlay hints - auto_inlay_hints = false, + auto_inlay_hints = true, + inlay_hints_highlight = "Comment", + inlay_hints_priority = 200, -- priority of the hint extmarks + inlay_hints_throttle = 150, -- throttle the inlay hint request + inlay_hints_format = { -- format options for individual hint kind + Type = {}, + Parameter = {}, + Enum = {}, + -- Example format customization for `Type` kind: + -- Type = { + -- highlight = "Comment", + -- text = function(text) + -- return "->" .. text:sub(2) + -- end, + -- }, + }, + update_imports_on_move = true, - require_confirmation_on_move = false, + require_confirmation_on_move = true, watch_dir = nil, }) @@ -97,6 +103,9 @@ vim.g.markdown_fenced_languages = { "ts=typescript", } +-- npm i -g vscode-langservers-extracted +require("lspconfig").eslint.setup({}) + require("lspconfig").denols.setup({ on_attach = lsp_keymaps, root_dir = require("lspconfig").util.root_pattern("deno.json"), diff --git a/nvim/lua/odas0r/telescope.lua b/nvim/lua/odas0r/telescope.lua index 4ae1ada..1630293 100644 --- a/nvim/lua/odas0r/telescope.lua +++ b/nvim/lua/odas0r/telescope.lua @@ -49,6 +49,38 @@ M.search_dotfiles = function() }) end +M.search_zet = function(tags) + if #tags == 0 then + require("telescope.builtin").live_grep({ + prompt_title = "[All]", + cwd = "~/github.com/odas0r/zet", + hidden = true, + }) + end + + local search = "" + + for index, tag in ipairs(tags) do + if index < #tags then + search = search .. tag .. "|" + else + search = search .. tag + end + end + + -- create the regex expression + search = "(" .. search .. ")" + + -- Search on zettel + require("telescope.builtin").grep_string({ + search = search, + prompt_title = "[All]: " .. search, + cwd = "~/github.com/odas0r/zet", + use_regex = true, + hidden = true, + }) +end + M.search_zet_fleet = function(tags) if #tags == 0 then require("telescope.builtin").live_grep({ @@ -77,7 +109,6 @@ M.search_zet_fleet = function(tags) prompt_title = "[Fleet]: " .. search, cwd = "~/github.com/odas0r/zet/fleet", use_regex = true, - word_match = "-w", hidden = true, }) end @@ -110,7 +141,6 @@ M.search_zet_permanent = function(tags) prompt_title = "[Permanent]: " .. search, cwd = "~/github.com/odas0r/zet/permanent", use_regex = true, - word_match = "-w", hidden = true, }) end diff --git a/nvim/plugin/defx.vim b/nvim/plugin/defx.vim index 92bca94..8db6497 100644 --- a/nvim/plugin/defx.vim +++ b/nvim/plugin/defx.vim @@ -3,7 +3,7 @@ " Press "K" on when cursor on top of defx -nnoremap \ Defx -columns=mark:indent:icon:space:git:filename -search=`expand('%:p')` `expand('%:p:h')` +nnoremap \ Defx -columns=mark:indent:icon:indent:filename:space:git -search=`expand('%:p')` `expand('%:p:h')` function! DefxMappings() " local options diff --git a/nvim/plugin/formatter.vim b/nvim/plugin/formatter.vim index 6670462..1723c2a 100644 --- a/nvim/plugin/formatter.vim +++ b/nvim/plugin/formatter.vim @@ -4,5 +4,11 @@ autocmd FocusGained * checktime augroup FormatAutogroup autocmd! + + " Formatter nnoremap gp FormatWrite + + " ESLint + autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll + augroup END diff --git a/nvim/plugin/terminal.vim b/nvim/plugin/terminal.vim index 8be007a..36b6eed 100644 --- a/nvim/plugin/terminal.vim +++ b/nvim/plugin/terminal.vim @@ -11,6 +11,8 @@ tnoremap augroup terminal_settings autocmd! + autocmd BufReadPost * execute ":lua terminal:close()" + autocmd TermOpen * startinsert | setlocal nonumber norelativenumber autocmd TermLeave * stopinsert diff --git a/nvim/spell/en.utf-8.add b/nvim/spell/en.utf-8.add index 07840eb..d74ac84 100644 --- a/nvim/spell/en.utf-8.add +++ b/nvim/spell/en.utf-8.add @@ -417,3 +417,8 @@ cli Alacritty alacritty xstate +sign-up +cssnano +Esc +F6 +F5 diff --git a/nvim/spell/en.utf-8.add.spl b/nvim/spell/en.utf-8.add.spl index 9b3277498cf814bf315835e0a65b93975b1b70e9..00ebc0db2b61ab67e4cd68b6847c01a8499efc36 100644 GIT binary patch delta 1222 zcmXw2O^6&-5bk>Yv)eP7-avK;*(K36KeKB)iAgY#jgXMAh%PxS!M*BCch66zd%Cx~ zXLrY+BrFVwxg^xZdk~D6MA<_wf-IYhdKGgP6!q#s(Fpog@5sQLey^&&`l{-y&*s0I zcUIrHnk7LPp7~eP%FACm9&HckEt;ZCX?#AH_73f8xG*@_-vz zji4K4Id!O^G`u(Yk@+U2{I~h}k^6nbYs%0Aq<9h!XsB8drQiqfhy27^qD3xEEYdD7 zO?-UKiqX9(>O~`c{F7$9ALG>S zB}m#=S{)&D*h3s~)xJO;uh`Sab+Ce~mmaYUffy~dmvX_a^mlmJ9ExAmb5#TcX zaJ$t2c+uxozEe6lbI=R_Z%P{JP2fE9TLM?-ozm;XY?l{iy|pYKtZ$&S*}J%1 zm+tb_^89QyGaEq*yiwYpGNTYlI%5Bt@05@0y5Hu<iIk84W)j8eZ5>siy+Ts&_Xrod6KR-8#TG_8q;n z*nlYZlwuw70VnoiX3xf9#;LSWhIUUBA~H6wc#wuR3xoZ;^a^dhHQv{1Xq`q{k!%Ker2L_CUO{|2 zPK|E!Z_d)qYD!J3?zh^V1Q4Yt7;FP(hlvqeC3$Au(Cc$ zXj3V*4(9$|HLl3ACkpMNpn5U%iFe0ZeHbV$~?5-JZE)t`||!@_5T3-vHpGl delta 1194 zcmXw2PiP!v6#w3vKbxKHZc2q>Q{#}Nc4OnLw1ox|#a@bN5S6Nngn+X%lif{bb|y2E zZ1$AWL#-Dt@1kHS8W9yQWeNH&2c=#eZo&I7`~w#N9unv)7KRaY0Tiy#s(uMd^o9Ns ztkGS43k+H|7G~S*RIkO5V<&@cXrXF=$2P4W!$1-b=!VgF#*R!k=tfx%9dJ>x|2_J} zcoW)m!u$bl(NE@cuul)oE6||X(h`hlt@K%^8KW~J<(F*sbI$MpqMPvQbI;U0RZ98Q60ui)>LmzSCW+dYPs znLr~s>iR%(^k&N4xsrW7(KzEqlJzyjZZ6IdeN{d;Yu9;tF#`nSP~DEu$$22cnsXk| z-{s3Q#-Wd>2k7M-=CGFmz7*cZ;!!1f+gf^OPih%_Mhutn$G6;NaIxb`W;m|DzEuoc zT2Qw=CSz8-@aYiSk=A15C;mFS^%?rpdL3@kOy$MX&8;lo-sv;N(}Mz7A7!w~QJPIb zWgaa0v~mjW(6^Nr5PkZs@;pxGbXb`~(K zwJ)L(2^))fAuujDAgq1_HhI-EaFT9T=TCV74@GY#+px>MpoqR0aY}cqGqw9&47yw+ z=OE*N4y$LEpG``B*h?fSBHLe#Xhe! zVnfJZt8kPb$*g!m*T!$u3eEFeR%Dy;CfoE~Z4vnaKCabakF3cndsYf9)A85aorEFe zt!TEK@p#T zUplB#Z!FOL098o8PEJ)fWT)kmJ>H-GFa0xl2EL}L Date: Mon, 18 Apr 2022 21:39:30 +0100 Subject: [PATCH 10/22] faster hide for the :term --- nvim/plugin/terminal.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/plugin/terminal.vim b/nvim/plugin/terminal.vim index 36b6eed..0775b7e 100644 --- a/nvim/plugin/terminal.vim +++ b/nvim/plugin/terminal.vim @@ -11,7 +11,7 @@ tnoremap augroup terminal_settings autocmd! - autocmd BufReadPost * execute ":lua terminal:close()" + autocmd BufReadPre * execute ":lua terminal:close()" autocmd TermOpen * startinsert | setlocal nonumber norelativenumber autocmd TermLeave * stopinsert From 35fa2c280d1437b3b56409c2689ddc24910caa03 Mon Sep 17 00:00:00 2001 From: odas0R Date: Tue, 19 Apr 2022 14:55:20 +0100 Subject: [PATCH 11/22] just a commit --- nvim/lua/odas0r/formatter.lua | 7 ++++++- nvim/plugin/terminal.vim | 1 + nvim/plugin/zet.vim | 3 +-- nvim/spell/en.utf-8.add | 2 ++ nvim/spell/en.utf-8.add.spl | Bin 5195 -> 5202 bytes scripts/gitsync | 2 +- 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/nvim/lua/odas0r/formatter.lua b/nvim/lua/odas0r/formatter.lua index 6a5dc0b..bc768d9 100644 --- a/nvim/lua/odas0r/formatter.lua +++ b/nvim/lua/odas0r/formatter.lua @@ -4,7 +4,12 @@ local formatter = require("formatter") local prettierConfig = function() return { exe = "prettier", - args = { "--stdin-filepath", vim.fn.shellescape(vim.api.nvim_buf_get_name(0)), "--double-quote" }, + args = { + "--stdin-filepath", + vim.fn.shellescape(vim.api.nvim_buf_get_name(0)), + "--double-quote", + "--prose-wrap always", + }, stdin = true, } end diff --git a/nvim/plugin/terminal.vim b/nvim/plugin/terminal.vim index 0775b7e..673d8fb 100644 --- a/nvim/plugin/terminal.vim +++ b/nvim/plugin/terminal.vim @@ -12,6 +12,7 @@ augroup terminal_settings autocmd! autocmd BufReadPre * execute ":lua terminal:close()" + autocmd BufWinEnter * execute ":lua terminal:close()" autocmd TermOpen * startinsert | setlocal nonumber norelativenumber autocmd TermLeave * stopinsert diff --git a/nvim/plugin/zet.vim b/nvim/plugin/zet.vim index 9150181..0d31b62 100644 --- a/nvim/plugin/zet.vim +++ b/nvim/plugin/zet.vim @@ -4,9 +4,8 @@ nnoremap zp lua require("odas0r.telescope").search_zet_permanent()< " add files to the history of zettelkasten augroup zettelkasten_history au! + " add to history - au BufWinEnter ~/github.com/odas0r/zet-cmd/.zet/**/*.md silent !zet history.insert % au BufWinEnter ~/github.com/odas0r/zet/fleet/*.md silent !zet history.insert % au BufWinEnter ~/github.com/odas0r/zet/permanent/*.md silent !zet history.insert % - au BufWinEnter ~/github.com/odas0r/zet/permanent/*.md silent !zet history.insert % augroup end diff --git a/nvim/spell/en.utf-8.add b/nvim/spell/en.utf-8.add index d74ac84..f00961b 100644 --- a/nvim/spell/en.utf-8.add +++ b/nvim/spell/en.utf-8.add @@ -422,3 +422,5 @@ cssnano Esc F6 F5 +webapp +#ash diff --git a/nvim/spell/en.utf-8.add.spl b/nvim/spell/en.utf-8.add.spl index 00ebc0db2b61ab67e4cd68b6847c01a8499efc36..4a2e9b667326e09d9470199ef145a91b90fe6d8c 100644 GIT binary patch delta 52 zcmX@DaY=(O%+t5HAT=k)=syDkx8FuSSAKDJ-Ncl%^o#<=M8*O}Mh0eW5Xm%ob29%6 F767HV4s`$k delta 45 zcmcblaaw~f%+t5HAT=k)=syDkxA#UqSAGFD-ITQSi~`0)#sWr024?NeS^O_p07%UZ A2><{9 diff --git a/scripts/gitsync b/scripts/gitsync index a361b8d..e96925b 100755 --- a/scripts/gitsync +++ b/scripts/gitsync @@ -18,7 +18,7 @@ _sync() { # Check if there are uncommitted changes if [ -n "$(git status --porcelain)" ]; then git add . - git commit -m "automated/scripted commit and push " -q + git commit -m "Gitsync: $(date +%Y-%m-%d)" -q git pull -q git push -q fi From 0ac331894014ee5ceb42093daa5377e1039a4f88 Mon Sep 17 00:00:00 2001 From: odas0R Date: Tue, 19 Apr 2022 21:34:24 +0100 Subject: [PATCH 12/22] updated neovim and packages, fixed the breaking changes --- bash/aliases.sh | 3 --- bash/editor.sh | 20 ++------------------ nvim/lua/odas0r/cmp.lua | 16 +++++++++++----- scripts/dot | 2 +- scripts/newx | 2 +- 5 files changed, 15 insertions(+), 28 deletions(-) diff --git a/bash/aliases.sh b/bash/aliases.sh index d6cb6f4..f303c06 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -8,9 +8,6 @@ alias sb="source ~/.bashrc" alias hosts="sudoedit /etc/hosts" -# Use nvr to avoid nesting nvim in Terminal buffers. -alias nvim="nvim-nvr" - # you can't cd on the current shell process by "cd-ing" on a shell script # https://stackoverflow.com/questions/255414/why-cant-i-change-directories-using-cd-in-a-script jump() { diff --git a/bash/editor.sh b/bash/editor.sh index c63762e..babd60e 100644 --- a/bash/editor.sh +++ b/bash/editor.sh @@ -10,21 +10,5 @@ fi export HRULEWIDTH=73 # Define the editor -if [[ ! -x "$(command -v nvim-nvr)" ]]; then - export VISUAL=/usr/bin/vim - export EDITOR="$VISUAL" -else - if [[ $OSTYPE == "darwin"* ]]; then - VISUAL=/usr/local/bin/nvim - EDITOR="$VISUAL" - - export VISUAL - export EDITOR - else - VISUAL=/usr/bin/nvim - EDITOR="$VISUAL" - - export VISUAL - export EDITOR - fi -fi +export VISUAL=/usr/bin/nvim +export EDITOR="$VISUAL" diff --git a/nvim/lua/odas0r/cmp.lua b/nvim/lua/odas0r/cmp.lua index 5e1c01a..3ad4b16 100644 --- a/nvim/lua/odas0r/cmp.lua +++ b/nvim/lua/odas0r/cmp.lua @@ -23,7 +23,18 @@ end local cmp = require("cmp") cmp.setup({ + snippet = { + expand = function(args) + vim.fn["UltiSnips#Anon"](args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, mapping = { + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.confirm({ @@ -72,11 +83,6 @@ cmp.setup({ { name = "vim-dadbod-completion" }, { name = "ultisnips" }, }), - snippet = { - expand = function(args) - vim.fn["UltiSnips#Anon"](args.body) - end, - }, formatting = { format = lspkind.cmp_format({ with_text = true, diff --git a/scripts/dot b/scripts/dot index dafd714..ef4a306 100755 --- a/scripts/dot +++ b/scripts/dot @@ -4,7 +4,7 @@ set -e if [[ -n $1 ]]; then # find the files by regex & open them w/ vim - find "$HOME/dot" -type f -name "*$1*" -exec nvim-nvr '{}' + + find "$HOME/dot" -type f -name "*$1*" -exec nvim '{}' + exit 0 fi diff --git a/scripts/newx b/scripts/newx index fa386a5..3db7071 100755 --- a/scripts/newx +++ b/scripts/newx @@ -7,7 +7,7 @@ path="$HOME/.local/bin/scripts/${1}" if [[ -e $path ]]; then read -r -p "${1} already exists. Edit?" yes case "$yes" in - y | yes | ok | okay) exec nvim-nvr "$path" ;; + y | yes | ok | okay) exec nvim "$path" ;; esac exit 0 fi From ffa2d62354de3fe819a6b6501aed3857b56cb0d8 Mon Sep 17 00:00:00 2001 From: odas0R Date: Sat, 23 Apr 2022 13:30:33 +0100 Subject: [PATCH 13/22] removed shitty typescript plugin --- nvim/init.vim | 1 - nvim/lua/odas0r/lsp.lua | 108 +++++++---------------------------- nvim/spell/en.utf-8.add | 13 ++++- nvim/spell/en.utf-8.add.spl | Bin 5202 -> 5307 bytes nvim/ultisnips/css.snippets | 37 ++---------- nvim/ultisnips/scss.snippets | 5 ++ scripts/lzg | 14 +++-- 7 files changed, 52 insertions(+), 126 deletions(-) create mode 100644 nvim/ultisnips/scss.snippets diff --git a/nvim/init.vim b/nvim/init.vim index 7990a51..f0e2058 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -136,7 +136,6 @@ Plug 'kristijanhusak/vim-dadbod-completion' " lsp, Completion Engine Plug 'neovim/nvim-lspconfig' Plug 'onsails/lspkind-nvim' -Plug 'jose-elias-alvarez/nvim-lsp-ts-utils' " yank over OSC Plug 'ojroques/vim-oscyank', {'branch': 'main'} diff --git a/nvim/lua/odas0r/lsp.lua b/nvim/lua/odas0r/lsp.lua index e523c63..1b29caa 100644 --- a/nvim/lua/odas0r/lsp.lua +++ b/nvim/lua/odas0r/lsp.lua @@ -30,79 +30,13 @@ local debounce_text_changes = 150 -- npm install -g typescript typescript-language-server require("lspconfig").tsserver.setup({ - -- Needed for inlayHints. Merge this table with your settings or copy - -- it from the source if you want to add your own init_options. - init_options = require("nvim-lsp-ts-utils").init_options, - on_attach = function(client, bufnr) - local ts_utils = require("nvim-lsp-ts-utils") - ts_utils.setup({ - debug = false, - disable_commands = false, - enable_import_on_completion = true, - - -- import all - import_all_timeout = 5000, -- ms - -- lower numbers = higher priority - import_all_priorities = { - same_file = 1, -- add to existing import statement - local_files = 2, -- git files or files with relative path markers - buffer_content = 3, -- loaded buffer content - buffers = 4, -- loaded buffer names - }, - import_all_scan_buffers = 100, - import_all_select_source = false, - always_organize_imports = true, - - -- filter diagnostics - filter_out_diagnostics_by_severity = {}, - filter_out_diagnostics_by_code = {}, - - -- inlay hints - auto_inlay_hints = true, - inlay_hints_highlight = "Comment", - inlay_hints_priority = 200, -- priority of the hint extmarks - inlay_hints_throttle = 150, -- throttle the inlay hint request - inlay_hints_format = { -- format options for individual hint kind - Type = {}, - Parameter = {}, - Enum = {}, - -- Example format customization for `Type` kind: - -- Type = { - -- highlight = "Comment", - -- text = function(text) - -- return "->" .. text:sub(2) - -- end, - -- }, - }, - - update_imports_on_move = true, - require_confirmation_on_move = true, - watch_dir = nil, - }) - - -- required to fix code action ranges and filter diagnostics - ts_utils.setup_client(client) - - -- set default keymaps - lsp_keymaps(client, bufnr) - - -- set custom keymaps to typescript development - local opts = { noremap = true, silent = true } - vim.api.nvim_buf_set_keymap(bufnr, "n", "gs", ":TSLspOrganize", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "f", ":TSLspRenameFile", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", ":TSLspImportAll", opts) - end, - + on_attach = lsp_keymaps, capabilities = capabilities, flags = { debounce_text_changes, }, }) -vim.g.markdown_fenced_languages = { - "ts=typescript", -} - -- npm i -g vscode-langservers-extracted require("lspconfig").eslint.setup({}) @@ -116,19 +50,19 @@ require("lspconfig").denols.setup({ -- https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#java_language_server -- https://github.com/georgewfraser/java-language-server -local home = os.getenv("HOME") -require("lspconfig").java_language_server.setup({ - on_attach = lsp_keymaps, - capabilities = capabilities, - flags = { - debounce_text_changes, - }, - cmd = { home .. "/tools/javalsp/dist/lang_server_mac.sh" }, - root_dir = function(fname) - return require("lspconfig").util.root_pattern("pom.xml", "gradle.build", ".classpath", ".git")(fname) - or vim.fn.getcwd() - end, -}) +-- local home = os.getenv("HOME") +-- require("lspconfig").java_language_server.setup({ +-- on_attach = lsp_keymaps, +-- capabilities = capabilities, +-- flags = { +-- debounce_text_changes, +-- }, +-- cmd = { home .. "/tools/javalsp/dist/lang_server_mac.sh" }, +-- root_dir = function(fname) +-- return require("lspconfig").util.root_pattern("pom.xml", "gradle.build", ".classpath", ".git")(fname) +-- or vim.fn.getcwd() +-- end, +-- }) -- require("lspconfig").jdtls.setup({ -- on_attach = on_attach, @@ -171,13 +105,13 @@ require("lspconfig").bashls.setup({ }) -- npm install -g @tailwindcss/language-server -require("lspconfig").tailwindcss.setup({ - on_attach = lsp_keymaps, - capabilities = capabilities, - flags = { - debounce_text_changes, - }, -}) +-- require("lspconfig").tailwindcss.setup({ +-- on_attach = lsp_keymaps, +-- capabilities = capabilities, +-- flags = { +-- debounce_text_changes, +-- }, +-- }) -- pip install 'python-lsp-server[all]' require("lspconfig").pylsp.setup({ diff --git a/nvim/spell/en.utf-8.add b/nvim/spell/en.utf-8.add index f00961b..afeebde 100644 --- a/nvim/spell/en.utf-8.add +++ b/nvim/spell/en.utf-8.add @@ -1,6 +1,6 @@ STDOUT zettels -zettelkasten +#ettelkasten reddit fzf Backend @@ -424,3 +424,14 @@ F6 F5 webapp #ash +mvp +full-text-search +fuzzy-finding +#ettelkasten +zettelkasten +tcp +ufw +testing-ui +gx +Kepubify +Freewind.scss diff --git a/nvim/spell/en.utf-8.add.spl b/nvim/spell/en.utf-8.add.spl index 4a2e9b667326e09d9470199ef145a91b90fe6d8c..7ad218f9fc2a0673aa3c61ee756cf140b9d96035 100644 GIT binary patch delta 723 zcmX9*O=uHA6rMM`NjE>c3DknMs0m1Fkt9^af`(e89u%aOqTnG7o9v`6-6Y%W#w0yd z=uPpUJc8muAzlPQl!6|5Gz9BK@g_YKrALoO1cmx0GB7jm=lk9_-+Vc_J!RaueARP> z2ry z2YK8JT}#YaoU4MDeCkh=OH|&IQUV(_dGFvt_}o}uG6iUtzIwDM+Qz5huY{8>wyt`_iXcx|+^=J}1=O=)*~2&38g$QAgGFCsq7;nC>4(I1Xed@f%#KrecV z-ux_@J#*a}en6dcN#0dXA4@G}o&1t^_;kvz3~cz|kT9yfL$1$iVUy%wN#I5O(xJjC z4VDtCurg#~4;pw^pB#TF$W*oCHlU?2&NIX{d@!F6TE3;dH6iuGwwhi!!ZE|=*Fhu8+KzUc#Au+l-`s6hYD4d VRL|qz*a`T7$#@P1Tg&mE%0H)htr`FT delta 617 zcmXX@OK1~O6rFo#rpaWI$%v_ZBG^Sh=|aRs(Flr5cka6rU9>KQF7(|X58m(GbKZI9zAt|}Ze2ZpDGG$| z&;L~vbLow>qvf#Pfffi@hAuP!6y>gp!0b9YF@)oTY73}?!^NkY z&_KoGiZ87MU$}zjRnPB)TO0aynA~hbj0$Qh1D`rw=u;u_7)JCe@f;jFlU#rU)K5-Z ztoOp1sEZX)v`rc&1$>~Ku>dP{(a6Ic62=utcxM!jI-&GcXTpO(1qGi3QBOtmVtJ*F zXxCVT8LFl(PiZcqCfIrm73eWMWVd>)!+VD|QYQ}%SV@;N=Mc#uPxt9pYWnaY$CpGV zVAxWZC1c;^khBVw&9$7f7RBA0J^A@Ue@v5a56ug(O@GW7G-{>KP7b{P3aZsW{@IAO z(=(8xAL;6eyemN=W3900eiOymRyCB(;51^na?W}!mi^#HXb)*Aa|)AndX_ndr6&E% zl=2;c5^;hqtg8y*tmKS!?o!2?$|iO^6rNKBg8@ZZ0dMJhb`D;WX&2!Z&D+JyZI0O}wKZwXAYmVa*YwC/dev/null 2>&1 } -is_in_git_repo || (echo "You're not in a git repo" && exit 1) - if [[ ! -x "$(command -v lazygit)" ]]; then echo "You need to install lazygit" exit 1 fi -root=$(git rev-parse --show-toplevel) +if [[ -d "$1" ]]; then + cd "$1" + is_in_git_repo || (echo "You're not in a git repo" && exit 1) + root=$(git rev-parse --show-toplevel) + popup lazygit -p "$root" "${@:1}" -popup lazygit -p "$root" "$@" +else + is_in_git_repo || (echo "You're not in a git repo" && exit 1) + root=$(git rev-parse --show-toplevel) + popup lazygit -p "$root" "$@" +fi From aa46b4d450977e2bd42bff0dc78d14efacb9b074 Mon Sep 17 00:00:00 2001 From: odas0R Date: Sat, 23 Apr 2022 20:39:14 +0100 Subject: [PATCH 14/22] changed back to gruvbox :) --- bash/fzf.sh | 12 ++++++------ lazygit/config.yml | 2 +- nvim/init.vim | 6 ++++-- nvim/lua/odas0r/init.lua | 2 +- nvim/lua/odas0r/lsp.lua | 2 +- nvim/lua/odas0r/{status.lua => lualine.lua} | 2 +- nvim/lua/odas0r/telescope.lua | 12 ++++++++---- nvim/plugin/colorscheme.vim | 19 +++++++++++-------- scripts/dot | 4 ++-- scripts/newx | 2 +- tmux/tmux.conf | 20 +++++++++++++++----- 11 files changed, 51 insertions(+), 32 deletions(-) rename nvim/lua/odas0r/{status.lua => lualine.lua} (89%) diff --git a/bash/fzf.sh b/bash/fzf.sh index c3dcf4a..2298c33 100644 --- a/bash/fzf.sh +++ b/bash/fzf.sh @@ -10,13 +10,13 @@ FZF_STYLES="--height=90% --layout=reverse --preview-window right:60%" # --color=fg:#c0caf5,bg:#1a1b26,hl:#bb9af7 -FZF_TOKYO_THEME=' - --color=fg:#c0caf5,hl:#bb9af7 - --color=fg+:#c0caf5,bg+:#1a1b26,hl+:#7dcfff - --color=info:#7aa2f7,prompt:#7dcfff,pointer:#7dcfff - --color=marker:#9ece6a,spinner:#9ece6a,header:#9ece6a' +# FZF_TOKYO_THEME=' +# --color=fg:#c0caf5,hl:#bb9af7 +# --color=fg+:#c0caf5,bg+:#1a1b26,hl+:#7dcfff +# --color=info:#7aa2f7,prompt:#7dcfff,pointer:#7dcfff +# --color=marker:#9ece6a,spinner:#9ece6a,header:#9ece6a' -export FZF_DEFAULT_OPTS="--no-mouse ${FZF_STYLES} ${FZF_BINDS} ${FZF_TOKYO_THEME}" +export FZF_DEFAULT_OPTS="--no-mouse ${FZF_STYLES} ${FZF_BINDS}" export FZF_DEFAULT_COMMAND="fd --hidden --type f --type l ${FD_OPTIONS}" export FZF_CTRL_T_COMMAND="fd ${FD_OPTIONS}" diff --git a/lazygit/config.yml b/lazygit/config.yml index bfbc8b5..1409120 100644 --- a/lazygit/config.yml +++ b/lazygit/config.yml @@ -52,7 +52,7 @@ git: # one of always, never, when-maximised # this determines whether the git graph is rendered in the commits panel showGraph: 'when-maximised' - skipHookPrefix: 'WIP:' + skipHookPrefix: 'WIP' autoFetch: true branchLogCmd: 'git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --' allBranchesLogCmd: 'git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium' diff --git a/nvim/init.vim b/nvim/init.vim index f0e2058..81e4cc1 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -105,10 +105,11 @@ nnoremap :nohl call plug#begin() +" theme +Plug 'ellisonleao/gruvbox.nvim' + " treesitter shit -Plug 'folke/tokyonight.nvim', { 'branch': 'main' } Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} -Plug 'windwp/nvim-ts-autotag' " status line Plug 'nvim-lualine/lualine.nvim' @@ -120,6 +121,7 @@ Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } Plug 'numToStr/Comment.nvim' Plug 'JoosepAlviste/nvim-ts-context-commentstring' +Plug 'windwp/nvim-ts-autotag' Plug 'ThePrimeagen/harpoon' Plug 's1n7ax/nvim-terminal' Plug 'mhinz/vim-signify' diff --git a/nvim/lua/odas0r/init.lua b/nvim/lua/odas0r/init.lua index 77366df..5bc6de5 100644 --- a/nvim/lua/odas0r/init.lua +++ b/nvim/lua/odas0r/init.lua @@ -2,7 +2,7 @@ require("odas0r.checkbox") require("odas0r.lsp") require("odas0r.efm") require("odas0r.cmp") -require("odas0r.status") +require("odas0r.lualine") require("odas0r.formatter") require("odas0r.cmp_gh") require("odas0r.comment") diff --git a/nvim/lua/odas0r/lsp.lua b/nvim/lua/odas0r/lsp.lua index 1b29caa..a614c62 100644 --- a/nvim/lua/odas0r/lsp.lua +++ b/nvim/lua/odas0r/lsp.lua @@ -26,7 +26,7 @@ local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protoco local lsp_util = require("lspconfig").util -local debounce_text_changes = 150 +local debounce_text_changes = 250 -- npm install -g typescript typescript-language-server require("lspconfig").tsserver.setup({ diff --git a/nvim/lua/odas0r/status.lua b/nvim/lua/odas0r/lualine.lua similarity index 89% rename from nvim/lua/odas0r/status.lua rename to nvim/lua/odas0r/lualine.lua index 9a72a50..af38c7d 100644 --- a/nvim/lua/odas0r/status.lua +++ b/nvim/lua/odas0r/lualine.lua @@ -11,7 +11,7 @@ lsp_status.config({ }) require("lualine").setup({ - options = { theme = "tokyonight", section_separators = "", component_separators = "" }, + options = { theme = "gruvbox_dark", section_separators = "", component_separators = "" }, section_separators = {}, sections = { lualine_a = { "mode" }, diff --git a/nvim/lua/odas0r/telescope.lua b/nvim/lua/odas0r/telescope.lua index 1630293..4ad1ee2 100644 --- a/nvim/lua/odas0r/telescope.lua +++ b/nvim/lua/odas0r/telescope.lua @@ -14,11 +14,15 @@ require("telescope").setup({ sorting_strategy = "ascending", mappings = { i = { - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - - [""] = actions.toggle_all, + [""] = actions.toggle_all, + [""] = actions.send_selected_to_qflist + actions.open_qflist }, + n = { + [""] = actions.toggle_all, + ["l"] = actions.toggle_selection, + ["h"] = actions.remove_selection, + [""] = actions.send_selected_to_qflist + actions.open_qflist + } }, prompt_prefix = " > ", selection_caret = " ", diff --git a/nvim/plugin/colorscheme.vim b/nvim/plugin/colorscheme.vim index f1ee954..8c0ee17 100644 --- a/nvim/plugin/colorscheme.vim +++ b/nvim/plugin/colorscheme.vim @@ -1,12 +1,15 @@ " Documentation: tokyonight " -" Press "K" on when cursor on top of defx +" Press "K" on when cursor on top of ... -let g:tokyonight_style = "night" -let g:tokyonight_italic_functions = 0 -let g:tokyonight_transparent = 1 -colorscheme tokyonight +set background=dark " or light if you want light mode +colorscheme gruvbox -" change themes -nnoremap 8 :let g:tokyonight_style = "night":colorscheme default:colorscheme tokyonight -nnoremap 9 :let g:tokyonight_style = "day":colorscheme default:colorscheme tokyonight +let g:gruvbox_bold = 1 +let g:gruvbox_italic = 1 +let g:gruvbox_transparent_bg = 1 +let g:gruvbox_underline = 1 +let g:gruvbox_undercurl = 1 + +" soft, medium, hard +let g:gruvbox_contrast_dark = "medium" diff --git a/scripts/dot b/scripts/dot index ef4a306..9f3c298 100755 --- a/scripts/dot +++ b/scripts/dot @@ -12,7 +12,7 @@ cd "$HOME/dot" file=$( fzf-tmux -p 95% --multi \ --prompt="Search through your dotfiles > " \ - --preview 'bat --theme=ansi --style=numbers --color=always {}' + --preview 'bat --theme=gruvbox-dark --style=numbers --color=always {}' ) if [[ -f $file ]]; then @@ -21,6 +21,6 @@ if [[ -f $file ]]; then open "$(basename "$file")" exit 0 else - nvim-nvr "$file" + nvim "$file" fi fi diff --git a/scripts/newx b/scripts/newx index 3db7071..ed4ee06 100755 --- a/scripts/newx +++ b/scripts/newx @@ -20,4 +20,4 @@ set -euxo pipefail EOF chmod +x "$path" -nvim-nvr +2 "$path" +nvim +2 "$path" diff --git a/tmux/tmux.conf b/tmux/tmux.conf index b8f3908..6997961 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -13,11 +13,21 @@ set -g mouse on set-option -g focus-events on # colors -set -g status-style fg="#a9b1d6" -set -g window-status-current-style fg="#73daca" -set -g pane-border-style fg=colour238 -set -g pane-active-border-style fg=colour244 -set -g message-style fg="#fb4934" +# +# gruvbox +set-option -g status-style fg=colour250 # bg=bg1, fg=fg1 +set-window-option -g window-status-current-style fg=colour223 # fg=bg1 +set-option -g pane-border-style fg=colour237 #bg1 +set-option -g pane-active-border-style fg=colour250 #fg2 +set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1 + +# tokyonight +# +# set -g status-style fg="#a9b1d6" +# set -g window-status-current-style fg="#73daca" +# set -g pane-border-style fg=colour238 +# set -g pane-active-border-style fg=colour244 +# set -g message-style fg="#fb4934" # status set -g status-left '' From 7c2ab6055b646d0060871f2300178c64c868071b Mon Sep 17 00:00:00 2001 From: odas0R Date: Sat, 23 Apr 2022 23:46:47 +0100 Subject: [PATCH 15/22] improve performance on `nvim-cmp` --- nvim/lua/odas0r/cmp.lua | 10 ++++++ nvim/lua/odas0r/cmp_gh.lua | 69 ------------------------------------ nvim/lua/odas0r/debounce.lua | 19 ++++++++++ nvim/lua/odas0r/efm.lua | 19 ++-------- nvim/lua/odas0r/init.lua | 2 +- nvim/lua/odas0r/lsp.lua | 9 ++--- 6 files changed, 38 insertions(+), 90 deletions(-) delete mode 100644 nvim/lua/odas0r/cmp_gh.lua create mode 100644 nvim/lua/odas0r/debounce.lua diff --git a/nvim/lua/odas0r/cmp.lua b/nvim/lua/odas0r/cmp.lua index 3ad4b16..f30c89f 100644 --- a/nvim/lua/odas0r/cmp.lua +++ b/nvim/lua/odas0r/cmp.lua @@ -23,6 +23,9 @@ end local cmp = require("cmp") cmp.setup({ + completion = { + autocomplete = false + }, snippet = { expand = function(args) vim.fn["UltiSnips#Anon"](args.body) @@ -97,3 +100,10 @@ cmp.setup({ }), }, }) + +vim.cmd([[ + augroup CmpDebounceAuGroup + au! + au TextChangedI * lua require("odas0r.debounce").debounce() + augroup end +]]) diff --git a/nvim/lua/odas0r/cmp_gh.lua b/nvim/lua/odas0r/cmp_gh.lua deleted file mode 100644 index e63a424..0000000 --- a/nvim/lua/odas0r/cmp_gh.lua +++ /dev/null @@ -1,69 +0,0 @@ -local Job = require("plenary.job") - -local source = {} - -source.new = function() - local self = setmetatable({ cache = {} }, { __index = source }) - - return self -end - -source.complete = function(self, _, callback) - local bufnr = vim.api.nvim_get_current_buf() - - -- This just makes sure that we only hit the GH API once per session. - -- - -- You could remove this if you wanted, but this just makes it so we're - -- good programming citizens. - if not self.cache[bufnr] then - Job - :new({ - -- Uses `gh` executable to request the issues from the remote repository. - "gh", - "issue", - "list", - "--limit", - "1000", - "--json", - "title,number,body", - - on_exit = function(job) - local result = job:result() - local ok, parsed = pcall(vim.json.decode, table.concat(result, "")) - if not ok then - vim.notify("Failed to parse gh result") - return - end - - local items = {} - for _, gh_item in ipairs(parsed) do - gh_item.body = string.gsub(gh_item.body or "", "\r", "") - - table.insert(items, { - label = string.format("#%s", gh_item.number), - documentation = { - kind = "markdown", - value = string.format("# %s\n\n%s", gh_item.title, gh_item.body), - }, - }) - end - - callback({ items = items, isIncomplete = false }) - self.cache[bufnr] = items - end, - }) - :start() - else - callback({ items = self.cache[bufnr], isIncomplete = false }) - end -end - -source.get_trigger_characters = function() - return { "#" } -end - -source.is_available = function() - return vim.bo.filetype == "gitcommit" -end - -require("cmp").register_source("gh_issues", source.new()) diff --git a/nvim/lua/odas0r/debounce.lua b/nvim/lua/odas0r/debounce.lua new file mode 100644 index 0000000..8784a02 --- /dev/null +++ b/nvim/lua/odas0r/debounce.lua @@ -0,0 +1,19 @@ +local M = {} + +local cmp = require("cmp") +local timer = vim.loop.new_timer() + +local DEBOUNCE_DELAY = 150 + +function M.debounce() + timer:stop() + timer:start( + DEBOUNCE_DELAY, + 0, + vim.schedule_wrap(function() + cmp.complete({ reason = cmp.ContextReason.Auto }) + end) + ) +end + +return M diff --git a/nvim/lua/odas0r/efm.lua b/nvim/lua/odas0r/efm.lua index 392c347..829d43a 100644 --- a/nvim/lua/odas0r/efm.lua +++ b/nvim/lua/odas0r/efm.lua @@ -19,15 +19,6 @@ local on_attach = function(_, bufnr) buf_set_keymap("n", "J", "lua vim.diagnostic.goto_next()", opts) end --- Eslint Setup with efm --- https://github.com/neovim/nvim-lspconfig/wiki/User-contributed-tips#eslint_d -local eslint = { - lintCommand = "eslint_d -f unix --stdin --stdin-filename ${INPUT}", - lintStdin = true, - lintFormats = { "%f:%l:%c: %m" }, - lintIgnoreExitCode = true, -} - local shellcheck = { lintCommand = "shellcheck -f gcc -x", lintSource = "shellcheck", @@ -48,18 +39,14 @@ require("lspconfig").efm.setup({ debounce_text_changes, }, init_options = { documentFormatting = false }, - filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "sh" }, + filetypes = { "sh" }, root_dir = function(fname) - return util.root_pattern("tsconfig.json")(fname) or util.root_pattern(".eslintrc.js", ".git")(fname) or "" + return util.root_pattern(".git")(fname) or "" end, settings = { - rootMarkers = { ".eslintrc.js", ".git/" }, + rootMarkers = { ".git/" }, languages = { sh = { shellcheck }, - javascript = { eslint }, - javascriptreact = { eslint }, - typescript = { eslint }, - typescriptreact = { eslint }, }, }, }) diff --git a/nvim/lua/odas0r/init.lua b/nvim/lua/odas0r/init.lua index 5bc6de5..6539173 100644 --- a/nvim/lua/odas0r/init.lua +++ b/nvim/lua/odas0r/init.lua @@ -4,8 +4,8 @@ require("odas0r.efm") require("odas0r.cmp") require("odas0r.lualine") require("odas0r.formatter") -require("odas0r.cmp_gh") require("odas0r.comment") +require("odas0r.debounce") require("odas0r.treesitter") require("odas0r.telescope") require("odas0r.harpoon") diff --git a/nvim/lua/odas0r/lsp.lua b/nvim/lua/odas0r/lsp.lua index a614c62..029ac93 100644 --- a/nvim/lua/odas0r/lsp.lua +++ b/nvim/lua/odas0r/lsp.lua @@ -24,9 +24,9 @@ end local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) -local lsp_util = require("lspconfig").util +local util = require("lspconfig").util -local debounce_text_changes = 250 +local debounce_text_changes = 150 -- npm install -g typescript typescript-language-server require("lspconfig").tsserver.setup({ @@ -42,7 +42,8 @@ require("lspconfig").eslint.setup({}) require("lspconfig").denols.setup({ on_attach = lsp_keymaps, - root_dir = require("lspconfig").util.root_pattern("deno.json"), + capabilities = capabilities, + root_dir = util.root_pattern("deno.json"), init_options = { lint = true, }, @@ -127,7 +128,7 @@ require("lspconfig").pylsp.setup({ require("lspconfig").gopls.setup({ cmd = { "gopls", "serve" }, filetypes = { "go", "gomod" }, - root_dir = require("lspconfig").util.root_pattern("go.work", "go.mod", ".git"), + root_dir = util.root_pattern("go.work", "go.mod", ".git"), settings = { gopls = { analyses = { From 4f52c1f69d527811882995af080100dc0f31d0a7 Mon Sep 17 00:00:00 2001 From: odas0R Date: Wed, 27 Apr 2022 11:01:26 +0100 Subject: [PATCH 16/22] some pretty changes :) --- nvim/init.vim | 12 +++--- nvim/lua/odas0r/cmp.lua | 27 ++++++++---- nvim/lua/odas0r/debounce.lua | 2 +- nvim/lua/odas0r/nvim-terminal.lua | 2 +- nvim/lua/odas0r/telescope.lua | 2 +- nvim/plugin/{colorscheme.vim => gruvbox.vim} | 7 +++- nvim/plugin/zet.vim | 4 +- nvim/spell/en.utf-8.add | 8 ++++ nvim/spell/en.utf-8.add.spl | Bin 5307 -> 5398 bytes nvim/ultisnips/markdown.snippets | 16 ++++---- nvim/ultisnips/typescript.snippets | 41 ++++++++++++------- scripts/cmd | 2 +- scripts/dot | 4 +- scripts/newx | 4 +- scripts/nextday | 4 +- scripts/nvim-nvr | 14 ------- scripts/nvimr | 17 ++++++++ scripts/open | 2 +- scripts/prevday | 4 +- scripts/tmuxin | 2 +- scripts/today | 4 +- scripts/todos | 2 +- tmux/tmux.conf | 2 +- 23 files changed, 110 insertions(+), 72 deletions(-) rename nvim/plugin/{colorscheme.vim => gruvbox.vim} (65%) delete mode 100755 scripts/nvim-nvr create mode 100755 scripts/nvimr diff --git a/nvim/init.vim b/nvim/init.vim index 81e4cc1..3d13ea2 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -108,7 +108,7 @@ call plug#begin() " theme Plug 'ellisonleao/gruvbox.nvim' -" treesitter shit +" treesitter Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " status line @@ -119,13 +119,16 @@ Plug 'nvim-lua/lsp-status.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } -Plug 'numToStr/Comment.nvim' -Plug 'JoosepAlviste/nvim-ts-context-commentstring' Plug 'windwp/nvim-ts-autotag' Plug 'ThePrimeagen/harpoon' Plug 's1n7ax/nvim-terminal' Plug 'mhinz/vim-signify' + +" comments, utilities for documentation +Plug 'numToStr/Comment.nvim' +Plug 'JoosepAlviste/nvim-ts-context-commentstring' + " newtr replacement because newtr sucks Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'kristijanhusak/defx-git' @@ -149,6 +152,7 @@ Plug 'hrsh7th/cmp-nvim-lua' Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-buffer' Plug 'quangnguyen30192/cmp-nvim-ultisnips' +Plug 'tzachar/cmp-tabnine', { 'do': './install.sh' } " formatter Plug 'mhartington/formatter.nvim' @@ -198,7 +202,5 @@ let g:completion_matching_ignore_case = 1 lua << EOF -- import all configs require("odas0r") - - -- Reload modules on save require("plenary.reload").reload_module("odas0r", true) EOF diff --git a/nvim/lua/odas0r/cmp.lua b/nvim/lua/odas0r/cmp.lua index f30c89f..96fcf54 100644 --- a/nvim/lua/odas0r/cmp.lua +++ b/nvim/lua/odas0r/cmp.lua @@ -24,7 +24,7 @@ local cmp = require("cmp") cmp.setup({ completion = { - autocomplete = false + autocomplete = false, }, snippet = { expand = function(args) @@ -36,8 +36,8 @@ cmp.setup({ documentation = cmp.config.window.bordered(), }, mapping = { - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.select_prev_item(), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.confirm({ @@ -85,6 +85,7 @@ cmp.setup({ }, { name = "vim-dadbod-completion" }, { name = "ultisnips" }, + { name = "cmp_tabnine" }, }), formatting = { format = lspkind.cmp_format({ @@ -96,14 +97,22 @@ cmp.setup({ ["vim-dadbod-completion"] = "[Sql]", ultisnips = "[Snip]", buffer = "[Buffer]", + cmp_tabnine = "[TN]", }, }), }, }) -vim.cmd([[ - augroup CmpDebounceAuGroup - au! - au TextChangedI * lua require("odas0r.debounce").debounce() - augroup end -]]) +local t = require("telescope.state") + +local callback = function() + -- if telescope is open don't execute `cmp` + if #t.get_existing_prompts() ~= 2 then + return require("odas0r.debounce").debounce() + end +end + +vim.api.nvim_create_autocmd({ "TextChangedI" }, { + pattern = { "*" }, + callback = callback, +}) diff --git a/nvim/lua/odas0r/debounce.lua b/nvim/lua/odas0r/debounce.lua index 8784a02..b5172fc 100644 --- a/nvim/lua/odas0r/debounce.lua +++ b/nvim/lua/odas0r/debounce.lua @@ -3,7 +3,7 @@ local M = {} local cmp = require("cmp") local timer = vim.loop.new_timer() -local DEBOUNCE_DELAY = 150 +local DEBOUNCE_DELAY = 250 function M.debounce() timer:stop() diff --git a/nvim/lua/odas0r/nvim-terminal.lua b/nvim/lua/odas0r/nvim-terminal.lua index d6d3d8b..620136f 100644 --- a/nvim/lua/odas0r/nvim-terminal.lua +++ b/nvim/lua/odas0r/nvim-terminal.lua @@ -5,7 +5,7 @@ local window = Window:new({ position = 'botright', split = 'sp', width = 100, - height = 30 + height = 35 }) terminal = Terminal:new(window) diff --git a/nvim/lua/odas0r/telescope.lua b/nvim/lua/odas0r/telescope.lua index 4ad1ee2..b2e7284 100644 --- a/nvim/lua/odas0r/telescope.lua +++ b/nvim/lua/odas0r/telescope.lua @@ -18,7 +18,7 @@ require("telescope").setup({ [""] = actions.send_selected_to_qflist + actions.open_qflist }, n = { - [""] = actions.toggle_all, + [""] = actions.toggle_all, ["l"] = actions.toggle_selection, ["h"] = actions.remove_selection, [""] = actions.send_selected_to_qflist + actions.open_qflist diff --git a/nvim/plugin/colorscheme.vim b/nvim/plugin/gruvbox.vim similarity index 65% rename from nvim/plugin/colorscheme.vim rename to nvim/plugin/gruvbox.vim index 8c0ee17..b8a3cf0 100644 --- a/nvim/plugin/colorscheme.vim +++ b/nvim/plugin/gruvbox.vim @@ -1,4 +1,4 @@ -" Documentation: tokyonight +" Documentation: gruvbox? " " Press "K" on when cursor on top of ... @@ -7,9 +7,12 @@ colorscheme gruvbox let g:gruvbox_bold = 1 let g:gruvbox_italic = 1 -let g:gruvbox_transparent_bg = 1 let g:gruvbox_underline = 1 let g:gruvbox_undercurl = 1 +" fix for transparent background +" let g:gruvbox_transparent_bg = 1 +autocmd VimEnter * hi Normal ctermbg=NONE guibg=NONE + " soft, medium, hard let g:gruvbox_contrast_dark = "medium" diff --git a/nvim/plugin/zet.vim b/nvim/plugin/zet.vim index 0d31b62..85d300c 100644 --- a/nvim/plugin/zet.vim +++ b/nvim/plugin/zet.vim @@ -1,5 +1,5 @@ -nnoremap zf lua require("odas0r.telescope").search_zet_fleet() -nnoremap zp lua require("odas0r.telescope").search_zet_permanent() +nnoremap zq lua require("odas0r.telescope").search_zet({}) +nnoremap zf !zet fix % " add files to the history of zettelkasten augroup zettelkasten_history diff --git a/nvim/spell/en.utf-8.add b/nvim/spell/en.utf-8.add index afeebde..4fcdbee 100644 --- a/nvim/spell/en.utf-8.add +++ b/nvim/spell/en.utf-8.add @@ -306,6 +306,7 @@ Canelhas Redbul Pracetamol LGTM +nvimr nvr searchbar afetar @@ -435,3 +436,10 @@ testing-ui gx Kepubify Freewind.scss +testing-apis +tdd +delete-later +Svelte-Kit +integration-testing +unit-testing +API's diff --git a/nvim/spell/en.utf-8.add.spl b/nvim/spell/en.utf-8.add.spl index 7ad218f9fc2a0673aa3c61ee756cf140b9d96035..f57e18801dd05de574642f013a0aec533f279853 100644 GIT binary patch delta 2102 zcmXw4U2GIp6u#%~%yzf`S`?d7rPMkWooY)=aEW3mSla?EY=IDYaJn^Yfi^ zc5U$Ot?h>=_EjS<2uA)DqUF+??e9?S;}2exJw`x+X3Nzj@+iT-O#wLsSvgT7sY~>` zBI77|>S-gSXVq868M;T!nMbpyE3^W&RHwRV4t3?iwBz|JrGR3k8UoyQW~BtB+#;P347D$^FqUsI@_F^xxw}(&Jbu- zU2yZd18kN{uWH(kTU>-SQ-h$+7LZGNr4Zni!Q_cBH3x)aZV_)rSq-*~(>b-+GT5`W zSWRk6%gC^2r2*Vir3GlEa_ZBTUG$6kqvgr$_5^Hmo@%^xfQl+?eP}voac=fHbDSl| zsAC^YB-7Fpr-U>Z$}$``UNH(mIi>~aacZf0ow#XZ;+WDk^;2vA6B7=q>}Ueh&$)o) zd#2qywr*xbF>zmr^9jBSe03o~&wF?>zEk_#`ZChy__L=})V8U$#X;ETz$%qorP}%k zX|>(kdujp6a&gL3B3nX9yiwB)C?50G&uv!sWe+tp)}k8Kk%b(BFU`nhWw-aWPx;dG z;WXhwyXsi`eXFlW8T52|xfqlqwu~`N9960})SjyFrO6nHQkXT|r2j0lkM|RJ-&xmW znqS1S%3UBn;y(+15kvjDBTUI-iTcLeES#Kyf}W$M-K z9owl>O?6mwLsdJDw&i%veJG!c774VNZFplb(jI)XnG2Z%%y}B)_ig*&W0q$0U0v&Xy3kCTuqLHf z1E3Gc5YBh)#Usm0z|b`1OVDo2+p6$w?(#Zo3@5`IhK;P|!<#D_hbmT`^_M^}3u#5!%-v#1pNB4rbR>eHoKsgrq-*G znA5OW?K|Ymuh4GocUsQ*a(~cJ$TQ_Lu!YtDld}vtu;thx7H!MZ1poX1kdsUR!Aa^$ z-zvc{#xpNLN6&+}#XlNcE#A|tMK4D(h*n|gL&^geF`lrhbOc#yqO1jW^?lyRd-Fc} zj;}{(PTDZfjH5OXxDi}1Rio=ohXJ9(fNPA07^ncgvDZbOC$*+Y4xx=*q^@;k9?3I7 z+;v9)#mmOiJ@3Fp9_Y%qcva0d!n2gS ZVUY6bwGDS}{AYau>N3z8A-R4P}RVCA- zdG(!nfx1*JbTYb9rX?a_kh&Qf+!*)5mhE`efQn>E0eMz!3LoB3nU~ps$}ki+Yh;tF zUJYN8=4};k*&K__$vKZIWI-*js+pEC8d8^99+&32`nKglWUVao8mS)H(f@)4mR4M9s`xs~|X&5HIF{Y8}`S??ZXY0I-{;<|$7m16t6e;PZ<*(>k(kI4`AX%Ul4fB$V*~ zfmwyla&qRH`lfYg>IR1j;q-u3#e=Ww7O-_4XRD#4m7hBUZ>|oKdLsue;dIW$r!G;& zGqUj6m!D(MjC!{15Gi$~t-p8eOf{(07r?N0NduefRhoyD5m&#pJw-pMc>B}Q{(wr5 z$yN1S`z{(*Z?->3arJe3_s|WUtP#ipGp`szn(W(WTKUS7nR81OnwK_nF`PxJBmW9< z65&a;wPWY-kcF~Zx>@0wJkn)-68g}-rkiP1bi>7EZhVeaX9IF!h=3oda~<1>)H@xU z`&%s}sB(7EE7!Q+^@SxSEe;eM>6T#c!%Oq}yW{@u%skj~bxKsw0mW-I^=PcG=Up4M zGuQkYErN_3L`dCGdUi#;jc=%d!dVJL+6%F`kAeEd&OW-KKJ7f&5$8RTiqGg>wY%$~J>egHT9i`Ofsk(`73Yd4CuB{!P@eD;XB{VX0P<_y~Q?~rBZguV7Xs#FO{r^U4*%Lzkq53v#S(a`Y z#brF34pSN&Q=q`>A`)d;=30rwXi0aM&m>J_sW?xO;C{QryC)JOd^`n^I!!j!RhdlF zC_3Qj+2<@pDn}ELU!6D<4Qk(Q0coq%|vvDxBtOAmm!nTs5pN*5h3sI%$%5q*y6^AMo8 z3UtJb<4GwpB z7r88ayK?>MoG)D;o(_b(Ek5IkM3qi}jV@?{?<8?6ZKmy_gZX0hUdqZOyhDdj0|-v} zh`>!5X->~Rj6cl+uQB{0QwDzX;!g38RINE%d^K?9df`%PxVxt}k);_r&dL47eH+x4 zjhR(J_wJpybI6qM2F9*HKL%U5%Gb$sBb|i$xVwKaRu;9>Q?# IN`n9X1-HA8^8f$< diff --git a/nvim/ultisnips/markdown.snippets b/nvim/ultisnips/markdown.snippets index 6eef974..eaeaeb4 100644 --- a/nvim/ultisnips/markdown.snippets +++ b/nvim/ultisnips/markdown.snippets @@ -4,20 +4,20 @@ priority -50 # Text # -snippet _ "italics" -_${1:${VISUAL}}_$0 +snippet _ "italics" +_${1:${VISUAL}}_ $0 endsnippet -snippet * "bold" -**${1:${VISUAL}}**$0 +snippet * "bold" +**${1:${VISUAL}}** $0 endsnippet -snippet _* "bold italics" -_**${1:${VISUAL}}**_$0 +snippet _* "bold italics" +_**${1:${VISUAL}}**_ $0 endsnippet -snippet /* "Comment" -$0 +snippet /* "Comment" + $0 endsnippet # diff --git a/nvim/ultisnips/typescript.snippets b/nvim/ultisnips/typescript.snippets index 2f442c0..4da9091 100644 --- a/nvim/ultisnips/typescript.snippets +++ b/nvim/ultisnips/typescript.snippets @@ -4,31 +4,28 @@ extends javascript extends html extends javascript-jsdoc -snippet int "interface" +snippet interface "interface" interface ${1} { + $0 }; endsnippet -snippet eint "interface" -export interface ${1} { -}; -endsnippet - -snippet ty "new type" +snippet type "new type" type $1 = $2; endsnippet -snippet ety "new type" -export type $1 = $2; +snippet export:interface "interface" +export interface ${1} { + $0 +}; endsnippet -snippet nspc "namespace" -namespace ${1} { -}; +snippet export:type "new type" +export type $1 = $2; endsnippet -snippet ex "export" -export $1 from "$2"; +snippet import "import a module" +import $2 from "$1"; endsnippet priority -49 @@ -37,3 +34,19 @@ function ${1:function_name} (${2:argument}: ${3:argument_type}) { ${VISUAL}$0 } endsnippet + +# Jest Snippets + +snippet describe "Jest suite test case" b +describe("$1", () => { + test("$2", () => { + $0 + }) +}) +endsnippet + +snippet test "Jest suite test case" b +test("$1", () => { + $0 +}) +endsnippet diff --git a/scripts/cmd b/scripts/cmd index bdc8712..de25e9d 100755 --- a/scripts/cmd +++ b/scripts/cmd @@ -4,5 +4,5 @@ set -e cmd="$(command -v "$1")" if [ -n "$cmd" ]; then - popup nvim "$cmd" + popup nvimr "$cmd" fi diff --git a/scripts/dot b/scripts/dot index 9f3c298..25b0b70 100755 --- a/scripts/dot +++ b/scripts/dot @@ -4,7 +4,7 @@ set -e if [[ -n $1 ]]; then # find the files by regex & open them w/ vim - find "$HOME/dot" -type f -name "*$1*" -exec nvim '{}' + + find "$HOME/dot" -type f -name "*$1*" -exec nvimr '{}' + exit 0 fi @@ -21,6 +21,6 @@ if [[ -f $file ]]; then open "$(basename "$file")" exit 0 else - nvim "$file" + nvimr "$file" fi fi diff --git a/scripts/newx b/scripts/newx index ed4ee06..d8d1118 100755 --- a/scripts/newx +++ b/scripts/newx @@ -7,7 +7,7 @@ path="$HOME/.local/bin/scripts/${1}" if [[ -e $path ]]; then read -r -p "${1} already exists. Edit?" yes case "$yes" in - y | yes | ok | okay) exec nvim "$path" ;; + y | yes | ok | okay) exec nvimr "$path" ;; esac exit 0 fi @@ -20,4 +20,4 @@ set -euxo pipefail EOF chmod +x "$path" -nvim +2 "$path" +nvimr +2 "$path" diff --git a/scripts/nextday b/scripts/nextday index af9d446..e415cdd 100755 --- a/scripts/nextday +++ b/scripts/nextday @@ -21,7 +21,7 @@ if [[ ! -f "$file" ]]; then export title="# Journal Entry, ${nextdayDate}" tmpl "$DAILY_TEMPLATE" >"$file" - popup nvim "$file" + popup nvimr "$file" else - popup nvim "$file" + popup nvimr "$file" fi diff --git a/scripts/nvim-nvr b/scripts/nvim-nvr deleted file mode 100755 index 5defd4a..0000000 --- a/scripts/nvim-nvr +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -e - -NVIM=$(which nvim) -if [[ -z "$NVIM_LISTEN_ADDRESS" ]]; then - $NVIM "$@" -else - if [[ -z "$*" ]]; then - nvr -l -c new - else - nvr -l "$@" - fi -fi diff --git a/scripts/nvimr b/scripts/nvimr new file mode 100755 index 0000000..7e629e9 --- /dev/null +++ b/scripts/nvimr @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +# TODO: Refactor this into using the builtin, check remote.txt + +declare NVIM_LISTEN_ADDRESS + +# Create a server per tmux session +NVIM_LISTEN_ADDRESS="/tmp/nvim_$(tmux display-message -p '#S')" +export NVIM_LISTEN_ADDRESS + +if [[ -z "$*" ]]; then + nvr -s -l -c enew +else + nvr -s -l "$@" +fi diff --git a/scripts/open b/scripts/open index 83ef59d..836efa3 100755 --- a/scripts/open +++ b/scripts/open @@ -5,4 +5,4 @@ set -e host="Guilherme Rosado@workstation.host" pass="Portimao325814" -sshpass -p "$pass" ssh "$host" "PsExec -i 1 cmd.exe /C start explorer.exe ${1}" +sshpass -p "$pass" ssh "$host" "PsExec -i 1 cmd.exe /C start brave.exe ${1}" diff --git a/scripts/prevday b/scripts/prevday index c0a20a5..80f38dc 100755 --- a/scripts/prevday +++ b/scripts/prevday @@ -23,7 +23,7 @@ if [[ ! -f $file ]]; then tmpl "$DAILY_TEMPLATE" >"$file" # Open the daily file - popup nvim "$file" + popup nvimr "$file" else - popup nvim "$file" + popup nvimr "$file" fi diff --git a/scripts/tmuxin b/scripts/tmuxin index 41eb64b..b603cb2 100755 --- a/scripts/tmuxin +++ b/scripts/tmuxin @@ -17,7 +17,7 @@ tmux new-session -d -s "$session" -c "$workspace" window=1 tmux rename-window -t "${session}:${window}" "neovim" -tmux send-keys -t "${session}:${window}" "nvim -c 'Telescope git_files'" C-m +tmux send-keys -t "${session}:${window}" "nvimr -c 'Telescope git_files'" C-m window=2 tmux new-window -t "${session}:${window}" -n "server" -c "$workspace" diff --git a/scripts/today b/scripts/today index 91a1929..a608010 100755 --- a/scripts/today +++ b/scripts/today @@ -16,7 +16,7 @@ if [[ ! -f "$file" ]]; then tmpl "$DAILY_TEMPLATE" >"$file" # Open the daily file - popup nvim "$file" + popup nvimr "$file" else - popup nvim "$file" + popup nvimr "$file" fi diff --git a/scripts/todos b/scripts/todos index 739cb4c..3ac90c5 100755 --- a/scripts/todos +++ b/scripts/todos @@ -2,4 +2,4 @@ ZET="$HOME/github.com/odas0r/zet" -popup -d "$ZET" nvim "$ZET/todos.md" +popup -d "$ZET" nvimr "$ZET/todos.md" diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 6997961..4106eaa 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -1,6 +1,6 @@ setw -g aggressive-resize on -set -g escape-time 0 +set -sg escape-time 0 set -g repeat-time 200 set -g history-limit 50001 From 8cbabacc6aa7193300ec07528a75dec0a1d2e822 Mon Sep 17 00:00:00 2001 From: odas0R Date: Wed, 27 Apr 2022 11:01:57 +0100 Subject: [PATCH 17/22] added `nvimr` to some global commands --- bash/aliases.sh | 4 ++++ gh/config.darwin.yml | 2 +- git/gitconfig | 12 ++++++------ nvim/plugin/markdown.vim | 5 +++++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/bash/aliases.sh b/bash/aliases.sh index f303c06..627d376 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -25,3 +25,7 @@ repos() { cd "$repo" || return } + +# check ~/dot/scripts/nvimr +# +alias nvim="nvimr" diff --git a/gh/config.darwin.yml b/gh/config.darwin.yml index 89c6df1..86d4bd5 100644 --- a/gh/config.darwin.yml +++ b/gh/config.darwin.yml @@ -1,5 +1,5 @@ git_protocol: ssh -editor: nvim +editor: nvimr prompt: enabled pager: less aliases: diff --git a/git/gitconfig b/git/gitconfig index a0d55b2..75e302c 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -10,12 +10,12 @@ [init] defaultBranch = main [diff] - tool = nvr -[difftool "nvr"] - cmd = nvr -s -d $LOCAL $REMOTE + tool = nvimr +[difftool "nvimr"] + cmd = nvimr -d $LOCAL $REMOTE [merge] - tool = nvr -[mergetool "nvr"] - cmd = nvr -s -d $LOCAL $BASE $REMOTE $MERGED -c 'wincmd J | wincmd =' + tool = nvimr +[mergetool "nvimr"] + cmd = nvimr -d $LOCAL $BASE $REMOTE $MERGED -c 'wincmd J | wincmd =' prompt = false keepBackup = false diff --git a/nvim/plugin/markdown.vim b/nvim/plugin/markdown.vim index 39d81e7..cf583b2 100644 --- a/nvim/plugin/markdown.vim +++ b/nvim/plugin/markdown.vim @@ -7,10 +7,15 @@ let g:netrw_browsex_viewer = "open" let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_conceal_code_blocks = 1 let g:vim_markdown_new_list_item_indent = 2 + let g:vim_markdown_no_extensions_in_markdown = 0 + let g:vim_markdown_autowrite = 1 let g:vim_markdown_edit_url_in = 'current' +" Experiments +let g:vim_markdown_conceal = 2 + " " Markdown Custom Settings " From f3aef544e3097c1744abecbc1f772c35ab94ad05 Mon Sep 17 00:00:00 2001 From: odas0R Date: Wed, 27 Apr 2022 11:32:17 +0100 Subject: [PATCH 18/22] omg, just figured out how to add treesitter highlights on markdown :'). It's been 20 years. --- nvim/init.vim | 5 +---- nvim/plugin/markdown.vim | 8 ++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index 3d13ea2..1b73f0b 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -110,6 +110,7 @@ Plug 'ellisonleao/gruvbox.nvim' " treesitter Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'nvim-treesitter/playground' " status line Plug 'nvim-lualine/lualine.nvim' @@ -173,10 +174,6 @@ au FileType * hi SpellBad ctermbg=NONE ctermfg=Red cterm=underline au FileType * hi Error ctermbg=NONE ctermfg=Red au FileType * hi ErrorMsg ctermbg=NONE ctermfg=Red -" give colors to **bold** and *italic* -highlight htmlBold gui=bold guifg=#e0af68 ctermfg=214 -highlight htmlItalic gui=italic guifg=#bb9af7 ctermfg=214 - hi MatchParen guibg=lightgray " diff --git a/nvim/plugin/markdown.vim b/nvim/plugin/markdown.vim index cf583b2..a035392 100644 --- a/nvim/plugin/markdown.vim +++ b/nvim/plugin/markdown.vim @@ -16,6 +16,14 @@ let g:vim_markdown_edit_url_in = 'current' " Experiments let g:vim_markdown_conceal = 2 +" Treesitter uses a differnt highlight group regarding markdown, etc: +" +" TSTitle, TSLiteral, TSEmphasis, TSStrong, TSURI, TSTextReference, +" TSPunctSpecial and TSStringEscape. +" +highlight TSStrong guifg=#fabd2f gui=bold +highlight TSEmphasis guifg=#d3869b gui=italic + " " Markdown Custom Settings " From 3aa444929615328f74f701a152010b483406596e Mon Sep 17 00:00:00 2001 From: Guilherme Rosado <32167770+Odas0R@users.noreply.github.com> Date: Sat, 30 Apr 2022 16:08:36 +0100 Subject: [PATCH 19/22] alacritty configs --- alacritty/alacritty.yml | 149 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 alacritty/alacritty.yml diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml new file mode 100644 index 0000000..5408f4d --- /dev/null +++ b/alacritty/alacritty.yml @@ -0,0 +1,149 @@ +# Example: https://github.com/alacritty/alacritty/blob/master/alacritty.yml +# +# ---------------------- +# TERM env customization. +# ---------------------- +env: + # If this property is not set, alacritty will set it to xterm-256color. + # + # Note that some xterm terminfo databases don't declare support for italics. + # You can verify this by checking for the presence of `smso` and `sitm` in + # `infocmp xterm-256color`. + TERM: xterm-256color + +# ---------------------- +# Font configuration +# ---------------------- +font: + # Font Size + size: 11 + offset: + x: 0 + y: 1 + + normal: + family: JetBrains Mono + style: Regular + bold: + family: JetBrains Mono + style: Bold + italic: + family: JetBrains Mono + style: Italic + bold_italic: + family: JetBrains Mono + style: Bold Italic +# ---------------------- +# Window Padding +# ---------------------- +# +window: + padding: + x: 8 + y: 8 + opacity: 0.8 + +# ---------------------- +# Others +# ---------------------- + +# Display tabs using this many cells (changes require restart) +# tabspaces: 8 + +# When true, bold text is drawn using the bright variant of colors. +draw_bold_text_with_bright_colors: true + +# Disable bell +visual_bell: + animation: EaseOutExpo + duration: 0 + +hide_cursor_when_typing: true + + +# ---------------------- +# THEME: Gruvbox +# ---------------------- +# +# Source: https://github.com/alacritty/alacritty/wiki/Color-schemes + +colors: + primary: + # hard contrast background - '#1d2021' + background: &gruvbox_dark_bg '#282828' + # soft contrast background - '#32302f' + foreground: '#ebdbb2' + bright_foreground: '#fbf1c7' + dim_foreground: '#a89984' + cursor: + text: CellBackground + cursor: CellForeground + vi_mode_cursor: + text: CellBackground + cursor: CellForeground + # search: + # matches: + # foreground: '#000000' + # background: '#ffffff' + # focused_match: + # foreground: CellBackground + # background: CellForeground + # bar: + # background: '' + # foreground: '' + # line_indicator: + # foreground: None + # background: None + selection: + text: CellBackground + background: CellForeground + bright: + black: '#928374' + red: '#fb4934' + green: '#b8bb26' + yellow: '#fabd2f' + blue: '#83a598' + magenta: '#d3869b' + cyan: '#8ec07c' + white: '#ebdbb2' + normal: + black: *gruvbox_dark_bg + red: '#cc241d' + green: '#98971a' + yellow: '#d79921' + blue: '#458588' + magenta: '#b16286' + cyan: '#689d6a' + white: '#a89984' + dim: + black: '#32302f' + red: '#9d0006' + green: '#79740e' + yellow: '#b57614' + blue: '#076678' + magenta: '#8f3f71' + cyan: '#427b58' + white: '#928374' + # indexed_colors: [] + +# ---------------------- +# Keybindings +# ---------------------- +key_bindings: +- { key: T, mods: Control, command: { program: "alacritty" } } +# copy-paste +- { key: V, mods: Control, action: Paste } +- { key: C, mods: Control, action: Copy } +# control + shift + c -> interrupt +- { key: C, mods: Control|Shift, chars: "\x03" } + +- { key: Paste, action: Paste } +- { key: Copy, action: Copy } +- { key: L, mods: Control, action: ClearLogNotice } +- { key: L, mods: Control, chars: "\x0c" } +- { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt } +- { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt } +- { key: Home, mods: Shift, action: ScrollToTop, mode: ~Alt } +- { key: End, mods: Shift, action: ScrollToBottom, mode: ~Alt } + +- { key: F11, action: ToggleFullscreen } From 9bbcf7702ca531c3479671512034b3e3df5cb38f Mon Sep 17 00:00:00 2001 From: odas0R Date: Sun, 1 May 2022 17:15:07 +0100 Subject: [PATCH 20/22] added better transparent bg, fixed playground vim plugin --- nvim/plugin/gruvbox.vim | 1 - nvim/plugin/playground.vim | 8 ++++---- nvim/plugin/transparent.vim | 10 ++++++++++ scripts/tmuxin | 1 - 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 nvim/plugin/transparent.vim diff --git a/nvim/plugin/gruvbox.vim b/nvim/plugin/gruvbox.vim index b8a3cf0..c2b40c7 100644 --- a/nvim/plugin/gruvbox.vim +++ b/nvim/plugin/gruvbox.vim @@ -12,7 +12,6 @@ let g:gruvbox_undercurl = 1 " fix for transparent background " let g:gruvbox_transparent_bg = 1 -autocmd VimEnter * hi Normal ctermbg=NONE guibg=NONE " soft, medium, hard let g:gruvbox_contrast_dark = "medium" diff --git a/nvim/plugin/playground.vim b/nvim/plugin/playground.vim index 35e38e6..81d652a 100644 --- a/nvim/plugin/playground.vim +++ b/nvim/plugin/playground.vim @@ -1,10 +1,10 @@ augroup Playground au! " bash - au FileType sh xnoremap r yPgv:!bash - au FileType sh nnoremap rp vapyPgv:!bash + au FileType sh xnoremap r yPgv:!bash + au FileType sh nnoremap rp vapyPgv:!bash " sql - au FileType sql xnoremap r :DB - au FileType sql nnoremap rp vap:DB + au FileType sql xnoremap r :DB + au FileType sql nnoremap rp vap:DB augroup end diff --git a/nvim/plugin/transparent.vim b/nvim/plugin/transparent.vim new file mode 100644 index 0000000..c00175e --- /dev/null +++ b/nvim/plugin/transparent.vim @@ -0,0 +1,10 @@ +highlight Normal guibg=NONE ctermbg=NONE +highlight CursorColumn cterm=NONE ctermbg=NONE ctermfg=NONE +highlight CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE +highlight CursorLineNr cterm=NONE ctermbg=NONE ctermfg=NONE +highlight SignColumn ctermbg=NONE cterm=NONE guibg=NONE gui=NONE + +" Signify Transparent Color +highlight SignifySignAdd ctermfg=green guifg=#00ff00 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE +highlight SignifySignDelete ctermfg=red guifg=#ff0000 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE +highlight SignifySignChange ctermfg=yellow guifg=#ffff00 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE diff --git a/scripts/tmuxin b/scripts/tmuxin index b603cb2..e4e97b4 100755 --- a/scripts/tmuxin +++ b/scripts/tmuxin @@ -17,7 +17,6 @@ tmux new-session -d -s "$session" -c "$workspace" window=1 tmux rename-window -t "${session}:${window}" "neovim" -tmux send-keys -t "${session}:${window}" "nvimr -c 'Telescope git_files'" C-m window=2 tmux new-window -t "${session}:${window}" -n "server" -c "$workspace" From b7a68666473ebf93292f4f06f702d30ec90b7324 Mon Sep 17 00:00:00 2001 From: odas0R Date: Tue, 3 May 2022 17:21:07 +0100 Subject: [PATCH 21/22] commit --- nvim/plugin/gruvbox.vim | 7 ------- nvim/plugin/indentation.vim | 11 +++++++++++ nvim/plugin/transparent.vim | 24 ++++++++++++++---------- scripts/todos | 2 +- 4 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 nvim/plugin/indentation.vim diff --git a/nvim/plugin/gruvbox.vim b/nvim/plugin/gruvbox.vim index c2b40c7..43247e1 100644 --- a/nvim/plugin/gruvbox.vim +++ b/nvim/plugin/gruvbox.vim @@ -1,7 +1,3 @@ -" Documentation: gruvbox? -" -" Press "K" on when cursor on top of ... - set background=dark " or light if you want light mode colorscheme gruvbox @@ -10,8 +6,5 @@ let g:gruvbox_italic = 1 let g:gruvbox_underline = 1 let g:gruvbox_undercurl = 1 -" fix for transparent background -" let g:gruvbox_transparent_bg = 1 - " soft, medium, hard let g:gruvbox_contrast_dark = "medium" diff --git a/nvim/plugin/indentation.vim b/nvim/plugin/indentation.vim new file mode 100644 index 0000000..1bdca77 --- /dev/null +++ b/nvim/plugin/indentation.vim @@ -0,0 +1,11 @@ +" Indentation fixes, settings + +function! IndentWithI() + if len(getline('.')) == 0 + return "\"_cc" + else + return "i" + endif +endfunction + +nnoremap i IndentWithI() diff --git a/nvim/plugin/transparent.vim b/nvim/plugin/transparent.vim index c00175e..7cddddf 100644 --- a/nvim/plugin/transparent.vim +++ b/nvim/plugin/transparent.vim @@ -1,10 +1,14 @@ -highlight Normal guibg=NONE ctermbg=NONE -highlight CursorColumn cterm=NONE ctermbg=NONE ctermfg=NONE -highlight CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE -highlight CursorLineNr cterm=NONE ctermbg=NONE ctermfg=NONE -highlight SignColumn ctermbg=NONE cterm=NONE guibg=NONE gui=NONE - -" Signify Transparent Color -highlight SignifySignAdd ctermfg=green guifg=#00ff00 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE -highlight SignifySignDelete ctermfg=red guifg=#ff0000 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE -highlight SignifySignChange ctermfg=yellow guifg=#ffff00 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE +augroup Transparent + au! + + au VimEnter * highlight Normal guibg=NONE ctermbg=NONE + au VimEnter * highlight CursorColumn cterm=NONE ctermbg=NONE ctermfg=NONE + au VimEnter * highlight CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE + au VimEnter * highlight CursorLineNr cterm=NONE ctermbg=NONE ctermfg=NONE + " au VimEnter * highlight SignColumn ctermbg=NONE cterm=NONE guibg=NONE gui=NONE + + " Signify Transparent Color + au VimEnter * highlight SignifySignAdd ctermfg=green guifg=#00ff00 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE + au VimEnter * highlight SignifySignDelete ctermfg=red guifg=#ff0000 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE + au VimEnter * highlight SignifySignChange ctermfg=yellow guifg=#ffff00 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE +augroup end diff --git a/scripts/todos b/scripts/todos index 3ac90c5..98eb354 100755 --- a/scripts/todos +++ b/scripts/todos @@ -2,4 +2,4 @@ ZET="$HOME/github.com/odas0r/zet" -popup -d "$ZET" nvimr "$ZET/todos.md" +nvimr "$ZET/todos.md" From 01a43d09fe2ecf23d88419cbdabfe25031cb9fe1 Mon Sep 17 00:00:00 2001 From: odas0R Date: Wed, 4 May 2022 07:13:15 +0100 Subject: [PATCH 22/22] hello~ --- nvim/plugin/transparent.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/plugin/transparent.vim b/nvim/plugin/transparent.vim index 7cddddf..acb2298 100644 --- a/nvim/plugin/transparent.vim +++ b/nvim/plugin/transparent.vim @@ -5,7 +5,7 @@ augroup Transparent au VimEnter * highlight CursorColumn cterm=NONE ctermbg=NONE ctermfg=NONE au VimEnter * highlight CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE au VimEnter * highlight CursorLineNr cterm=NONE ctermbg=NONE ctermfg=NONE - " au VimEnter * highlight SignColumn ctermbg=NONE cterm=NONE guibg=NONE gui=NONE + au VimEnter * highlight SignColumn ctermbg=NONE guibg=NONE " Signify Transparent Color au VimEnter * highlight SignifySignAdd ctermfg=green guifg=#00ff00 guibg=NONE ctermbg=NONE cterm=NONE gui=NONE