From 1bf3fb229d72a203a18cc596e73010313f5ac00d Mon Sep 17 00:00:00 2001 From: Steffen Rademacker Date: Sat, 3 Feb 2024 17:20:43 +0100 Subject: [PATCH] ditch nnn, use oil (enough), fix topgrade --- install/2_cli-tools.sh | 4 ---- nvim/init.lua | 20 ++++++++++---------- nvim/lua/plugins/floaterm.lua | 14 -------------- nvim/lua/plugins/oil.lua | 16 ++++++++++++++++ nvim/lua/plugins/which-key.lua | 4 +--- zsh/aliases.zsh | 17 +++++++++-------- zsh/exports.zsh | 9 --------- zsh/functions.zsh | 17 ----------------- zsh/zshrc | 1 + 9 files changed, 37 insertions(+), 65 deletions(-) delete mode 100644 nvim/lua/plugins/floaterm.lua create mode 100644 nvim/lua/plugins/oil.lua diff --git a/install/2_cli-tools.sh b/install/2_cli-tools.sh index 92b549a6..c5a24f1c 100755 --- a/install/2_cli-tools.sh +++ b/install/2_cli-tools.sh @@ -12,7 +12,6 @@ brew install fzf brew install imagemagick brew install jump brew install lazygit -brew install nnn brew install ocrmypdf brew install ripgrep brew install spotifyd @@ -21,9 +20,6 @@ brew install topgrade brew install tree brew install viu -# nnn plugins -curl -Ls https://raw.githubusercontent.com/jarun/nnn/master/plugins/getplugs | sh - ln -s ~/dotfiles/lazygit ~/.config/lazygit ln -s ~/dotfiles/starship.toml ~/.config/starship.toml ln -s ~/dotfiles/topgrade.toml ~/.config/topgrade.toml diff --git a/nvim/init.lua b/nvim/init.lua index 74693832..349f483b 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -63,8 +63,8 @@ require('lazy').setup({ { 'windwp/nvim-autopairs', event = 'InsertEnter', config = true }, -- more plugins and integrations + { 'stevearc/oil.nvim', config = get_config('oil'), dependencies = { 'nvim-tree/nvim-web-devicons' } }, { 'nvim-pack/nvim-spectre', dependencies = 'nvim-lua/plenary.nvim', config = true }, - { 'voldikss/vim-floaterm', config = get_config('floaterm') }, { 'mfussenegger/nvim-lint', config = get_config('lint') }, { 'stevearc/conform.nvim', event = 'BufWritePre', config = get_config('conform') }, { 'nvim-neorg/neorg', @@ -75,15 +75,15 @@ require('lazy').setup({ { 'github/copilot.vim' }, -- { 'zbirenbaum/copilot.lua', event = 'InsertEnter', config = get_config('copilot') }, -- { 'zbirenbaum/copilot-cmp', config = true }, - { 'jackMort/ChatGPT.nvim', - event = 'VeryLazy', - dependencies = { - 'MunifTanjim/nui.nvim', - 'nvim-lua/plenary.nvim', - 'nvim-telescope/telescope.nvim' - }, - config = true, - }, + -- { 'jackMort/ChatGPT.nvim', + -- event = 'VeryLazy', + -- dependencies = { + -- 'MunifTanjim/nui.nvim', + -- 'nvim-lua/plenary.nvim', + -- 'nvim-telescope/telescope.nvim' + -- }, + -- config = true, + -- }, }) -- general sane vim options diff --git a/nvim/lua/plugins/floaterm.lua b/nvim/lua/plugins/floaterm.lua deleted file mode 100644 index ef8f72c4..00000000 --- a/nvim/lua/plugins/floaterm.lua +++ /dev/null @@ -1,14 +0,0 @@ -local g = vim.g -local createCmd = vim.api.nvim_create_autocmd - -g.floaterm_width = 0.9 -g.floaterm_height = 0.9 -g.floaterm_autoclose = 1 -g.floaterm_opener = 'edit' -g.floaterm_borderchars = '─│─│╭╮╯╰' -g.floaterm_title = '' - -createCmd({ 'VimEnter' }, { - pattern = { '*' }, - command = "highlight FloatermBorder guibg='#282828' guifg='#fbf1c7'", -}) diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua new file mode 100644 index 00000000..9e67f944 --- /dev/null +++ b/nvim/lua/plugins/oil.lua @@ -0,0 +1,16 @@ +require('oil').setup({ + columns = { + 'mtime', + 'permissions', + 'size', + 'icon', + }, + delete_to_trash = true, + view_options = { + show_hidden = true, + }, + keymaps = { + [""] = "actions.close", + ["q"] = "actions.close", + }, +}) diff --git a/nvim/lua/plugins/which-key.lua b/nvim/lua/plugins/which-key.lua index 95efc4e3..46ce9e60 100644 --- a/nvim/lua/plugins/which-key.lua +++ b/nvim/lua/plugins/which-key.lua @@ -4,7 +4,7 @@ vim.opt.timeout = true vim.opt.timeoutlen = 500 wk.register({ - ['-'] = { 'FloatermNew nnn', 'invoke floaterm with nnn as file picker' }, + ['-'] = { 'Oil', 'Open file browser in parent directory' }, [';'] = { ':', 'Colon with semicolon' }, [''] = { 'checktimeredraw!', 'redraw/reload with F5' }, [''] = { 'blast', 'buffer navigation with arrow keys' }, @@ -64,8 +64,6 @@ wk.register({ b = { 'Telescope git_branches', 'git branches' }, c = { 'Telescope git_bcommits', 'commits for buffer' }, f = { 'Spectre', 'open spectre for search/replace' }, - l = { 'FloatermNew lazygit', 'open lazygit' }, - t = { 'FloatermNew', 'open new terminal' }, v = { name = 'vim related', e = { 'e $MYVIMRC', 'edit vimrc' }, diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 0c62240a..a25850e6 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -1,21 +1,22 @@ alias -- -='$EDITOR $(fzf)' alias ...='cd ../..' alias ..='cd ..' -alias O="cd ~ && mbsync -a && mu index" -alias g="git" -alias gd="git diff" +alias O='cd ~ && mbsync -a && mu index' +alias g='git' +alias gd='git diff' alias ggpl='git pull origin $(current_branch)' alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' alias ggps='git push origin $(current_branch)' alias gmo='$EDITOR $(git ls-files -m)' -alias gs="git status" +alias gs='git status' +alias l='nvim "+Oil"' alias lg='lazygit' alias m='neomutt' alias mutt='neomutt' -alias nb="npm run build" -alias np="npm run lint && npm run production" +alias nb='npm run build' +alias np='npm run lint && npm run production' alias nre='n engine && rm -f package-lock.json && rm -rf node_modules && npm install' -alias ns="npm start" +alias ns='npm start' alias q='exit' alias sudo='sudo ' alias to='tiptop --net en0' @@ -27,7 +28,7 @@ alias vi=$EDITOR alias ocrpdf='convert *.jpg -auto-orient temp.pdf && ocrmypdf --rotate-pages --optimize 3 --jpeg-quality 70 temp.pdf ocr.pdf' alias vim=$EDITOR alias vimdiff='$EDITOR -d' -alias vimup='nvim +TSUpdate' +alias vimup='nvim --headless "+TSUpdateSync" +qa && nvim --headless "+Lazy! sync" +qa' alias yb='yarn build' alias yp='yarn lint && yarn production' alias yre='n engine > /dev/null && rm -f yarn.lock && rm -rf node_modules && yarn' diff --git a/zsh/exports.zsh b/zsh/exports.zsh index 72d1b748..83067eec 100644 --- a/zsh/exports.zsh +++ b/zsh/exports.zsh @@ -26,15 +26,6 @@ export RIPGREP_CONFIG_PATH="$HOME/dotfiles/ripgreprc" export HOMEBREW_CASK_OPTS="--appdir=/Applications" export HOMEBREW_NO_ENV_HINTS=true -# nnn -export NNN_OPTS='deHR' -export NNN_BMS='a:~/Sites;s:~/Dotfiles;d:~/Downloads;h:~/' -export NNN_FCOLORS='c1e26c2e006033f5c6d6abc4' -export NNN_PLUG='p:preview-tui;j:autojump' -export NNN_FIFO='/Users/webgefrickel/.local/share/nnn/nnn.fifo' -export NNN_TRASH=0 -export NNN_ARCHIVE="\\.(7z|bz|bz2|gz|rar|rpm|tar|tgz|zip)$" - # pyenv export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" diff --git a/zsh/functions.zsh b/zsh/functions.zsh index 0aa961ad..c9e04e86 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -1,20 +1,3 @@ -# nnn terminal integration -l () { - if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then - echo "nnn is already running" - return - fi - - export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" - - nnn "$@" - - if [ -f "$NNN_TMPFILE" ]; then - . "$NNN_TMPFILE" - rm -f "$NNN_TMPFILE" > /dev/null - fi -} - # s as in 'show' / quicklook script s () { trap 'exit 0' 2 #traps Ctrl-C (signal 2) diff --git a/zsh/zshrc b/zsh/zshrc index c6d942a5..a4917ba2 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -20,6 +20,7 @@ zi snippet PZTM::completion # Fixes for unicode setopt COMBINING_CHARS +setopt NO_HUP # fixes topgrade # additional gruvbox colors source ~/.local/share/nvim/lazy/gruvbox-baby/extras/bash/MEDIUM.bash