From b6787ce03ccce574760f3ebfe426ac826d4904fa Mon Sep 17 00:00:00 2001 From: zonne13 Date: Mon, 24 Mar 2025 13:34:43 -0600 Subject: [PATCH] Initial commit for dotfiles --- fish/config.fish | 65 ++++++ fish/config.fish.bak | 37 ++++ fish/config.fish.bak2 | 42 ++++ fish/fish_plugins | 1 + fish/fish_variables | 38 ++++ fish/themes/Dracula Official.theme | 55 +++++ install.sh | 48 ++++ kitty/current-theme.conf | 50 +++++ kitty/kitty.conf | 198 +++++++++++++++++ kitty/kitty.conf.bak | 198 +++++++++++++++++ mc/ini | 147 ++++++++++++ mc/panels.ini | 35 +++ nvim/init.lua | 2 + nvim/lazy-lock.json | 61 +++++ nvim/lua/enrique/core/init.lua | 2 + nvim/lua/enrique/core/keymaps.lua | 190 ++++++++++++++++ nvim/lua/enrique/core/keymaps.lua.bak | 106 +++++++++ nvim/lua/enrique/core/options.lua | 49 ++++ nvim/lua/enrique/lazy.lua | 22 ++ nvim/lua/enrique/plugins/aerial.lua | 62 ++++++ nvim/lua/enrique/plugins/alpha.lua | 36 +++ nvim/lua/enrique/plugins/auto-session.lua | 16 ++ nvim/lua/enrique/plugins/autopairs.lua | 30 +++ nvim/lua/enrique/plugins/barbecue.lua | 31 +++ nvim/lua/enrique/plugins/bigfile.lua | 12 + nvim/lua/enrique/plugins/bufferline.lua | 28 +++ nvim/lua/enrique/plugins/cholorscheme.lua | 53 +++++ nvim/lua/enrique/plugins/comment.lua | 19 ++ nvim/lua/enrique/plugins/dadbod.lua | 13 ++ nvim/lua/enrique/plugins/dressing.lua | 4 + nvim/lua/enrique/plugins/flutter-tools.lua | 32 +++ nvim/lua/enrique/plugins/guess-indent.lua | 4 + nvim/lua/enrique/plugins/illuminate.lua | 4 + nvim/lua/enrique/plugins/indent-blankline.lua | 8 + nvim/lua/enrique/plugins/init.lua | 4 + nvim/lua/enrique/plugins/linting.lua | 25 +++ nvim/lua/enrique/plugins/lsp/lspconfig.lua | 124 +++++++++++ .../enrique/plugins/lsp/lspconfig.lua.bak2 | 76 +++++++ nvim/lua/enrique/plugins/lsp/mason.lua | 46 ++++ nvim/lua/enrique/plugins/lualine.lua | 59 +++++ nvim/lua/enrique/plugins/miniicons.lua | 4 + nvim/lua/enrique/plugins/neo-tree.lua | 21 ++ nvim/lua/enrique/plugins/noice.lua | 36 +++ nvim/lua/enrique/plugins/nvim-cmp.lua | 147 ++++++++++++ nvim/lua/enrique/plugins/quickfixdd.lua | 6 + nvim/lua/enrique/plugins/substitute.lua | 8 + nvim/lua/enrique/plugins/surround.lua | 6 + nvim/lua/enrique/plugins/telescope.lua | 37 ++++ nvim/lua/enrique/plugins/todo-comments.lua | 9 + nvim/lua/enrique/plugins/treesitter.lua | 49 ++++ nvim/lua/enrique/plugins/trouble.lua | 22 ++ nvim/lua/enrique/plugins/vim-maximizer.lua | 3 + nvim/lua/enrique/plugins/which-key.lua | 23 ++ starship.toml | 209 ++++++++++++++++++ uninstall.sh | 51 +++++ 55 files changed, 2663 insertions(+) create mode 100644 fish/config.fish create mode 100644 fish/config.fish.bak create mode 100644 fish/config.fish.bak2 create mode 100644 fish/fish_plugins create mode 100644 fish/fish_variables create mode 100644 fish/themes/Dracula Official.theme create mode 100755 install.sh create mode 100644 kitty/current-theme.conf create mode 100644 kitty/kitty.conf create mode 100644 kitty/kitty.conf.bak create mode 100644 mc/ini create mode 100644 mc/panels.ini create mode 100644 nvim/init.lua create mode 100644 nvim/lazy-lock.json create mode 100644 nvim/lua/enrique/core/init.lua create mode 100644 nvim/lua/enrique/core/keymaps.lua create mode 100644 nvim/lua/enrique/core/keymaps.lua.bak create mode 100644 nvim/lua/enrique/core/options.lua create mode 100644 nvim/lua/enrique/lazy.lua create mode 100644 nvim/lua/enrique/plugins/aerial.lua create mode 100644 nvim/lua/enrique/plugins/alpha.lua create mode 100644 nvim/lua/enrique/plugins/auto-session.lua create mode 100644 nvim/lua/enrique/plugins/autopairs.lua create mode 100644 nvim/lua/enrique/plugins/barbecue.lua create mode 100644 nvim/lua/enrique/plugins/bigfile.lua create mode 100644 nvim/lua/enrique/plugins/bufferline.lua create mode 100644 nvim/lua/enrique/plugins/cholorscheme.lua create mode 100644 nvim/lua/enrique/plugins/comment.lua create mode 100644 nvim/lua/enrique/plugins/dadbod.lua create mode 100644 nvim/lua/enrique/plugins/dressing.lua create mode 100644 nvim/lua/enrique/plugins/flutter-tools.lua create mode 100644 nvim/lua/enrique/plugins/guess-indent.lua create mode 100644 nvim/lua/enrique/plugins/illuminate.lua create mode 100644 nvim/lua/enrique/plugins/indent-blankline.lua create mode 100644 nvim/lua/enrique/plugins/init.lua create mode 100644 nvim/lua/enrique/plugins/linting.lua create mode 100644 nvim/lua/enrique/plugins/lsp/lspconfig.lua create mode 100644 nvim/lua/enrique/plugins/lsp/lspconfig.lua.bak2 create mode 100644 nvim/lua/enrique/plugins/lsp/mason.lua create mode 100644 nvim/lua/enrique/plugins/lualine.lua create mode 100644 nvim/lua/enrique/plugins/miniicons.lua create mode 100644 nvim/lua/enrique/plugins/neo-tree.lua create mode 100644 nvim/lua/enrique/plugins/noice.lua create mode 100644 nvim/lua/enrique/plugins/nvim-cmp.lua create mode 100644 nvim/lua/enrique/plugins/quickfixdd.lua create mode 100644 nvim/lua/enrique/plugins/substitute.lua create mode 100644 nvim/lua/enrique/plugins/surround.lua create mode 100644 nvim/lua/enrique/plugins/telescope.lua create mode 100644 nvim/lua/enrique/plugins/todo-comments.lua create mode 100644 nvim/lua/enrique/plugins/treesitter.lua create mode 100644 nvim/lua/enrique/plugins/trouble.lua create mode 100644 nvim/lua/enrique/plugins/vim-maximizer.lua create mode 100644 nvim/lua/enrique/plugins/which-key.lua create mode 100644 starship.toml create mode 100755 uninstall.sh diff --git a/fish/config.fish b/fish/config.fish new file mode 100644 index 0000000..4dcd510 --- /dev/null +++ b/fish/config.fish @@ -0,0 +1,65 @@ +fish_config theme choose "Dracula Official" + +if status is-interactive + # Commands to run in interactive sessions can go here +end + +function fish_greeting + # echo "Welcome Enrique" + # fastfetch +end + +function yy + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" + end + rm -f -- "$tmp" +end + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +if test -f /home/enrique/miniconda3/bin/conda + eval /home/enrique/miniconda3/bin/conda "shell.fish" "hook" $argv | source +else + if test -f "/home/enrique/miniconda3/etc/fish/conf.d/conda.fish" + . "/home/enrique/miniconda3/etc/fish/conf.d/conda.fish" + else + set -x PATH "/home/enrique/miniconda3/bin" $PATH + end +end +# <<< conda initialize <<< +conda deactivate + +## EVALS ## +# eval (/home/linuxbrew/.linuxbrew/bin/brew shellenv) +starship init fish | source +fzf --fish | source + + +## ALIASES ## +alias zy "sudo zypper" +alias zypper 'sudo zypper' +alias srcfish 'source ~/.config/fish/config.fish' +alias pull-st 'bash ~/bin/pull-st.sh' +alias push-st 'bash ~/bin/push-st.sh' +alias sentinel 'ssh -X admin@100.88.99.193 "/publico/sentinel"' +alias glowp 'glow -p' +alias glows 'glow -s dracula' +alias mdcht 'glow -s ~/Projects/Qt-Learning/Notes/xx-MarkDown-CheatSheet.md' +alias nv 'nvim' +alias aemu '~/Android/Sdk/emulator/emulator -avd API30_Flutter &' +## EXPORTS ## +set -Ux EDITOR nvim +set -Ux MICRO_TRUECOLOR 1 +fish_add_path -g -p ~/flutter-dev/flutter/bin +fish_add_path -g -p /opt/android-studio/bin +fish_add_path -g -p ~/.pub-cache/bin +fish_add_path -g -p /usr/local/bin +fish_add_path -g -p ~/.local/bin + + + +## NEOVIM DISTRO ## +set -Ux NVIM_APPNAME "nvim" diff --git a/fish/config.fish.bak b/fish/config.fish.bak new file mode 100644 index 0000000..e11817e --- /dev/null +++ b/fish/config.fish.bak @@ -0,0 +1,37 @@ +fish_config theme choose "Dracula Official" + +if status is-interactive + # Commands to run in interactive sessions can go here +end + +function fish_greeting + fastfetch +end + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +if test -f /home/enrique/miniconda3/bin/conda + eval /home/enrique/miniconda3/bin/conda "shell.fish" "hook" $argv | source +else + if test -f "/home/enrique/miniconda3/etc/fish/conf.d/conda.fish" + . "/home/enrique/miniconda3/etc/fish/conf.d/conda.fish" + else + set -x PATH "/home/enrique/miniconda3/bin" $PATH + end +end +# <<< conda initialize <<< + +## EVALS ## +eval (/home/linuxbrew/.linuxbrew/bin/brew shellenv) +starship init fish | source + + +## ALIASES ## +alias zy "sudo zypper" +alias conx '~/.scripts/x_session_ssh.sh' +alias sentinel '~/.scripts/sentinel_x_session.sh' +alias zypper 'sudo zypper' + + +## EXPORTS ## +set -Ux EDITOR micro diff --git a/fish/config.fish.bak2 b/fish/config.fish.bak2 new file mode 100644 index 0000000..dff21ec --- /dev/null +++ b/fish/config.fish.bak2 @@ -0,0 +1,42 @@ +fish_config theme choose "Dracula Official" + +if status is-interactive + # Commands to run in interactive sessions can go here +end + +function fish_greeting + # fastfetch +end + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +if test -f /home/enrique/miniconda3/bin/conda + eval /home/enrique/miniconda3/bin/conda "shell.fish" "hook" $argv | source +else + if test -f "/home/enrique/miniconda3/etc/fish/conf.d/conda.fish" + . "/home/enrique/miniconda3/etc/fish/conf.d/conda.fish" + else + set -x PATH "/home/enrique/miniconda3/bin" $PATH + end +end +# <<< conda initialize <<< + +## EVALS ## +eval (/home/linuxbrew/.linuxbrew/bin/brew shellenv) +starship init fish | source +fzf --fish | source + + +## ALIASES ## +alias zy "sudo zypper" +alias conx '~/.scripts/x_session_ssh.sh' +alias sentinel '~/.scripts/sentinel_x_session.sh' +alias zypper 'sudo zypper' +alias up 'sudo zypper dup && flatpak update && brew update && brew upgrade' +alias srcfish 'source .config/fish/config.fish' + + +## EXPORTS ## +set -Ux EDITOR micro +set -Ux MICRO_TRUECOLOR 1 + diff --git a/fish/fish_plugins b/fish/fish_plugins new file mode 100644 index 0000000..fd0366e --- /dev/null +++ b/fish/fish_plugins @@ -0,0 +1 @@ +dracula/fish diff --git a/fish/fish_variables b/fish/fish_variables new file mode 100644 index 0000000..b487efd --- /dev/null +++ b/fish/fish_variables @@ -0,0 +1,38 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR --export EDITOR:nvim +SETUVAR --export MICRO_TRUECOLOR:1 +SETUVAR --export NVIM_APPNAME:nvim +SETUVAR --export --path PATH:/home/linuxbrew/\x2elinuxbrew/bin\x1e/home/linuxbrew/\x2elinuxbrew/sbin\x1e/home/enrique/miniconda3/condabin\x1e/usr/local/bin\x1e/usr/bin\x1e/bin\x1e/usr/X11R6/bin\x1e/opt/nvim\x2dlinux64/bin +SETUVAR __fish_initialized:3400 +SETUVAR _fisher_dracula_2F_fish_files:\x7e/\x2econfig/fish/themes/Dracula\x20Official\x2etheme\x1e\x7e/\x2econfig/fish/conf\x2ed/dracula\x2efish +SETUVAR _fisher_plugins:dracula/fish +SETUVAR _fisher_upgraded_to_4_4:\x1d +SETUVAR fish_color_autosuggestion:555\x1ebrblack +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:005fd7 +SETUVAR fish_color_comment:990000 +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:009900 +SETUVAR fish_color_error:ff0000 +SETUVAR fish_color_escape:00a6b2 +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:00a6b2 +SETUVAR fish_color_param:00afff +SETUVAR fish_color_quote:999900 +SETUVAR fish_color_redirection:00afff +SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_completion:\x1d +SETUVAR fish_pager_color_description:B3A06D\x1eyellow +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_pager_color_selected_background:\x2dr diff --git a/fish/themes/Dracula Official.theme b/fish/themes/Dracula Official.theme new file mode 100644 index 0000000..6c1fd96 --- /dev/null +++ b/fish/themes/Dracula Official.theme @@ -0,0 +1,55 @@ +# Dracula Color Palette +# +# Foreground: f8f8f2 +# Selection: 44475a +# Comment: 6272a4 +# Red: ff5555 +# Orange: ffb86c +# Yellow: f1fa8c +# Green: 50fa7b +# Purple: bd93f9 +# Cyan: 8be9fd +# Pink: ff79c6 + +# Syntax Highlighting Colors +fish_color_normal f8f8f2 +fish_color_command 8be9fd +fish_color_keyword ff79c6 +fish_color_quote f1fa8c +fish_color_redirection f8f8f2 +fish_color_end ffb86c +fish_color_error ff5555 +fish_color_param bd93f9 +fish_color_comment 6272a4 +fish_color_selection --background=44475a +fish_color_search_match --background=44475a +fish_color_operator 50fa7b +fish_color_escape ff79c6 +fish_color_autosuggestion 6272a4 +fish_color_cancel ff5555 --reverse +fish_color_option ffb86c +fish_color_history_current --bold +fish_color_status ff5555 +fish_color_valid_path --underline + +# Default Prompt Colors +fish_color_cwd 50fa7b +fish_color_cwd_root red +fish_color_host bd93f9 +fish_color_host_remote bd93f9 +fish_color_user 8be9fd + +# Completion Pager Colors +fish_pager_color_progress 6272a4 +fish_pager_color_background +fish_pager_color_prefix 8be9fd +fish_pager_color_completion f8f8f2 +fish_pager_color_description 6272a4 +fish_pager_color_selected_background --background=44475a +fish_pager_color_selected_prefix 8be9fd +fish_pager_color_selected_completion f8f8f2 +fish_pager_color_selected_description 6272a4 +fish_pager_color_secondary_background +fish_pager_color_secondary_prefix 8be9fd +fish_pager_color_secondary_completion f8f8f2 +fish_pager_color_secondary_description 6272a4 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..adc5f38 --- /dev/null +++ b/install.sh @@ -0,0 +1,48 @@ +#!/bin/bash +set -e + +DOTFILES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +CONFIG_DIR="$HOME/.config" + +# Create config directory if it doesn't exist +mkdir -p "$CONFIG_DIR" + +# Function to backup existing config and create symlink +install_config() { + local name=$1 + local target="$CONFIG_DIR/$name" + + # Backup existing config if it exists and is not a symlink + if [ -e "$target" ] && [ ! -L "$target" ]; then + echo "Backing up existing $name config to ${target}.bak" + mv "$target" "${target}.bak" + elif [ -L "$target" ]; then + echo "Removing existing $name symlink" + rm "$target" + fi + + # Create symlink + echo "Creating symlink for $name" + ln -s "$DOTFILES_DIR/$name" "$target" +} + +# Install each config +echo "Installing dotfiles..." +install_config "fish" +install_config "mc" +install_config "nvim" +install_config "kitty" + +# Install starship.toml +if [ -e "$CONFIG_DIR/starship.toml" ] && [ ! -L "$CONFIG_DIR/starship.toml" ]; then + echo "Backing up existing starship.toml to ${CONFIG_DIR}/starship.toml.bak" + mv "$CONFIG_DIR/starship.toml" "${CONFIG_DIR}/starship.toml.bak" +elif [ -L "$CONFIG_DIR/starship.toml" ]; then + echo "Removing existing starship.toml symlink" + rm "$CONFIG_DIR/starship.toml" +fi + +echo "Creating symlink for starship.toml" +ln -s "$DOTFILES_DIR/starship.toml" "$CONFIG_DIR/starship.toml" + +echo "Dotfiles installation complete!" diff --git a/kitty/current-theme.conf b/kitty/current-theme.conf new file mode 100644 index 0000000..014901b --- /dev/null +++ b/kitty/current-theme.conf @@ -0,0 +1,50 @@ +# vim:ft=kitty + +## name: Tokyo Night Moon +## license: MIT +## author: Folke Lemaitre +## upstream: https://github.com/folke/tokyonight.nvim/raw/main/extras/kitty/tokyonight_moon.conf + + +background #222436 +foreground #c8d3f5 +selection_background #2d3f76 +selection_foreground #c8d3f5 +url_color #4fd6be +cursor #c8d3f5 +cursor_text_color #222436 + +# Tabs +active_tab_background #82aaff +active_tab_foreground #1e2030 +inactive_tab_background #2f334d +inactive_tab_foreground #545c7e +#tab_bar_background #1b1d2b + +# Windows +active_border_color #82aaff +inactive_border_color #2f334d + +# normal +color0 #1b1d2b +color1 #ff757f +color2 #c3e88d +color3 #ffc777 +color4 #82aaff +color5 #c099ff +color6 #86e1fc +color7 #828bb8 + +# bright +color8 #444a73 +color9 #ff757f +color10 #c3e88d +color11 #ffc777 +color12 #82aaff +color13 #c099ff +color14 #86e1fc +color15 #c8d3f5 + +# extended colors +color16 #ff966c +color17 #c53b53 diff --git a/kitty/kitty.conf b/kitty/kitty.conf new file mode 100644 index 0000000..ba0aceb --- /dev/null +++ b/kitty/kitty.conf @@ -0,0 +1,198 @@ +# vim:fileencoding=utf-8:foldmethod=marker +include current-theme.conf + +#: Fonts {{{ +font_family BlexMono Nerd Font Medium +bold_font BlexMono Nerd Font Bold +italic_font BlexMono Nerd Font Text Italic +bold_italic_font BlexMono Nerd Font SemiBold Italic +font_size 10.0 +modify_font cell_width 95% +# modify_font cell_height -2px +# modify_font baseline 3 + + +#: Cursor customization {{{ +# cursor #cccccc +# cursor_text_color #111111 +cursor_shape block +# cursor_shape_unfocused hollow +# cursor_blink_interval -1 +# cursor_stop_blinking_after 15.0 +#: }}} + +#: Scrollback {{{ + +# scrollback_lines 2000 +# scrollback_indicator_opacity 1.0 +# scrollback_fill_enlarged_window no +# wheel_scroll_multiplier 5.0 +# wheel_scroll_min_lines 1 +#: }}} + +#: Mouse {{{ +mouse_hide_wait 3.0 +# url_style curly +# open_url_with default +# detect_urls yes +# show_hyperlink_targets no +# underline_hyperlinks hover +# copy_on_select clipboard +# paste_actions quote-urls-at-prompt,replace-dangerous-control-codesm replace-newline, confirm-if-large#,confirm +# strip_trailing_spaces never +focus_follows_mouse yes + +#: Terminal bell {{{ +# enable_audio_bell yes +visual_bell_duration 2.0 +# visual_bell_color none +window_alert_on_bell yes +bell_on_tab "๐Ÿ”” " +#: }}} + +#: Window layout {{{ +remember_window_size no +initial_window_width 850 +initial_window_height 500 +enabled_layouts tall,* +window_resize_step_cells 2 +window_resize_step_lines 2 +window_border_width 2pt +# draw_minimal_borders yes +window_margin_width 9 +single_window_margin_width 0 +window_padding_width 0 3 +single_window_padding_width -1 +# placement_strategy center +# active_border_color #00ff00 +# inactive_border_color #cccccc +# bell_border_color #ff5a00 +# inactive_text_alpha 1.0 +hide_window_decorations yes + +#: Tab bar {{{ +tab_bar_edge top +# tab_bar_margin_width 20.0 +tab_bar_margin_height 9.0 0.0 +tab_bar_style powerline +# tab_bar_align left +tab_bar_min_tabs 1 +tab_switch_strategy previous +# tab_separator " โ”‡" +# tab_powerline_style round +# tab_activity_symbol none +# tab_title_max_length 0 +# tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" +#: title +#: The current tab title. +#: index +#: The tab index usable with goto_tab N goto_tab shortcuts. +#: layout_name +#: The current layout name. +#: num_windows +#: The number of windows in the tab. +#: num_window_groups +#: The number of window groups (a window group is a window and all of its overlay windows) in the tab. +#: tab.active_wd +#: The working directory of the currently active window in the tab +#: (expensive, requires syscall). Use active_oldest_wd to get +#: the directory of the oldest foreground process rather than the newest. +#: tab.active_exe +#: The name of the executable running in the foreground of the currently +#: active window in the tab (expensive, requires syscall). Use +#: active_oldest_exe for the oldest foreground process. +#: max_title_length +#: The maximum title length available. +#: keyboard_mode +#: The name of the current keyboard mode or the empty string if no keyboard mode is active. + +#: Note that formatting is done by Python's string formatting +#: machinery, so you can use, for instance, {layout_name[:2].upper()} +#: to show only the first two letters of the layout name, upper-cased. +#: If you want to style the text, you can use styling directives, for +#: example: +#: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. +#: Similarly, for bold and italic: +#: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. +#: Note that for backward compatibility, if {bell_symbol} or +#: {activity_symbol} are not present in the template, they are +#: prepended to it. + +# active_tab_title_template none + + +#: Color scheme {{{ +# foreground #dddddd +# background #000000 +background_opacity 0.72 +dynamic_background_opacity yes +# background_blur 0 +background_image none +# background_image_layout cscaled +background_tint 0.2 +background_tint_gaps 0.0 +# dim_opacity 0.4 +#: The color table {{{ +# color0 #000000 +# color8 #767676 +# color1 #cc0403 +# color9 #f2201f +# color2 #19cb00 +# color10 #23fd00 +# color3 #cecb00 +# color11 #fffd00 +# color4 #0d73cc +# color12 #1a8fff +# color5 #cb1ed1 +# color13 #fd28ff +# color6 #0dcdcd +# color14 #14ffff +# color7 #dddddd +# color15 #ffffff + +#: }}} + +#: Advanced {{{ +# shell . +editor nvim +# close_on_child_death no +# allow_remote_control no +# shell_integration enabled +# notify_on_cmd_finish always +term xterm-256color +#: menu_map global "Actions::Launch something special" launch --hold --type=os-window sh -c "echo hello world" +#: This will create a menu entry named "Launch something special" in +#: an "Actions" menu in the macOS global menubar. Sub-menus can be +#: created by adding more levels separated by the :: characters. +#: }}} + + +#: Keyboard shortcuts {{{ +#: For example: a for the A key, [ for the left square bracket key, +#: etc. For functional keys, such as Enter or Escape +#: For modifier keys, the names are ctrl, shift, alt, super. +#: # unmap a keyboard shortcut, passing it to the program running in kitty +#: map kitty_mod+space +#: # completely ignore a keyboard event +#: map ctrl+alt+f1 discard_event +#: # combine multiple actions +#: map kitty_mod+e combine : new_window : next_layout +#: # multi-key shortcuts +#: map ctrl+x>ctrl+y>z action +# kitty_mod ctrl+shift +# action_alias #: E.g. action_alias launch_tab launch --type=tab --cwd=current +#: map f1 launch_tab vim +#: map f2 launch_tab emacs + +backspace_key auto + +map alt+left neighboring_window left +map alt+right neighboring_window right +map alt+up neighboring_window up +map alt+down neighboring_window down + + +# BEGIN_KITTY_THEME +# Tokyo Night Moon +include current-theme.conf +# END_KITTY_THEME diff --git a/kitty/kitty.conf.bak b/kitty/kitty.conf.bak new file mode 100644 index 0000000..ba0aceb --- /dev/null +++ b/kitty/kitty.conf.bak @@ -0,0 +1,198 @@ +# vim:fileencoding=utf-8:foldmethod=marker +include current-theme.conf + +#: Fonts {{{ +font_family BlexMono Nerd Font Medium +bold_font BlexMono Nerd Font Bold +italic_font BlexMono Nerd Font Text Italic +bold_italic_font BlexMono Nerd Font SemiBold Italic +font_size 10.0 +modify_font cell_width 95% +# modify_font cell_height -2px +# modify_font baseline 3 + + +#: Cursor customization {{{ +# cursor #cccccc +# cursor_text_color #111111 +cursor_shape block +# cursor_shape_unfocused hollow +# cursor_blink_interval -1 +# cursor_stop_blinking_after 15.0 +#: }}} + +#: Scrollback {{{ + +# scrollback_lines 2000 +# scrollback_indicator_opacity 1.0 +# scrollback_fill_enlarged_window no +# wheel_scroll_multiplier 5.0 +# wheel_scroll_min_lines 1 +#: }}} + +#: Mouse {{{ +mouse_hide_wait 3.0 +# url_style curly +# open_url_with default +# detect_urls yes +# show_hyperlink_targets no +# underline_hyperlinks hover +# copy_on_select clipboard +# paste_actions quote-urls-at-prompt,replace-dangerous-control-codesm replace-newline, confirm-if-large#,confirm +# strip_trailing_spaces never +focus_follows_mouse yes + +#: Terminal bell {{{ +# enable_audio_bell yes +visual_bell_duration 2.0 +# visual_bell_color none +window_alert_on_bell yes +bell_on_tab "๐Ÿ”” " +#: }}} + +#: Window layout {{{ +remember_window_size no +initial_window_width 850 +initial_window_height 500 +enabled_layouts tall,* +window_resize_step_cells 2 +window_resize_step_lines 2 +window_border_width 2pt +# draw_minimal_borders yes +window_margin_width 9 +single_window_margin_width 0 +window_padding_width 0 3 +single_window_padding_width -1 +# placement_strategy center +# active_border_color #00ff00 +# inactive_border_color #cccccc +# bell_border_color #ff5a00 +# inactive_text_alpha 1.0 +hide_window_decorations yes + +#: Tab bar {{{ +tab_bar_edge top +# tab_bar_margin_width 20.0 +tab_bar_margin_height 9.0 0.0 +tab_bar_style powerline +# tab_bar_align left +tab_bar_min_tabs 1 +tab_switch_strategy previous +# tab_separator " โ”‡" +# tab_powerline_style round +# tab_activity_symbol none +# tab_title_max_length 0 +# tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" +#: title +#: The current tab title. +#: index +#: The tab index usable with goto_tab N goto_tab shortcuts. +#: layout_name +#: The current layout name. +#: num_windows +#: The number of windows in the tab. +#: num_window_groups +#: The number of window groups (a window group is a window and all of its overlay windows) in the tab. +#: tab.active_wd +#: The working directory of the currently active window in the tab +#: (expensive, requires syscall). Use active_oldest_wd to get +#: the directory of the oldest foreground process rather than the newest. +#: tab.active_exe +#: The name of the executable running in the foreground of the currently +#: active window in the tab (expensive, requires syscall). Use +#: active_oldest_exe for the oldest foreground process. +#: max_title_length +#: The maximum title length available. +#: keyboard_mode +#: The name of the current keyboard mode or the empty string if no keyboard mode is active. + +#: Note that formatting is done by Python's string formatting +#: machinery, so you can use, for instance, {layout_name[:2].upper()} +#: to show only the first two letters of the layout name, upper-cased. +#: If you want to style the text, you can use styling directives, for +#: example: +#: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. +#: Similarly, for bold and italic: +#: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. +#: Note that for backward compatibility, if {bell_symbol} or +#: {activity_symbol} are not present in the template, they are +#: prepended to it. + +# active_tab_title_template none + + +#: Color scheme {{{ +# foreground #dddddd +# background #000000 +background_opacity 0.72 +dynamic_background_opacity yes +# background_blur 0 +background_image none +# background_image_layout cscaled +background_tint 0.2 +background_tint_gaps 0.0 +# dim_opacity 0.4 +#: The color table {{{ +# color0 #000000 +# color8 #767676 +# color1 #cc0403 +# color9 #f2201f +# color2 #19cb00 +# color10 #23fd00 +# color3 #cecb00 +# color11 #fffd00 +# color4 #0d73cc +# color12 #1a8fff +# color5 #cb1ed1 +# color13 #fd28ff +# color6 #0dcdcd +# color14 #14ffff +# color7 #dddddd +# color15 #ffffff + +#: }}} + +#: Advanced {{{ +# shell . +editor nvim +# close_on_child_death no +# allow_remote_control no +# shell_integration enabled +# notify_on_cmd_finish always +term xterm-256color +#: menu_map global "Actions::Launch something special" launch --hold --type=os-window sh -c "echo hello world" +#: This will create a menu entry named "Launch something special" in +#: an "Actions" menu in the macOS global menubar. Sub-menus can be +#: created by adding more levels separated by the :: characters. +#: }}} + + +#: Keyboard shortcuts {{{ +#: For example: a for the A key, [ for the left square bracket key, +#: etc. For functional keys, such as Enter or Escape +#: For modifier keys, the names are ctrl, shift, alt, super. +#: # unmap a keyboard shortcut, passing it to the program running in kitty +#: map kitty_mod+space +#: # completely ignore a keyboard event +#: map ctrl+alt+f1 discard_event +#: # combine multiple actions +#: map kitty_mod+e combine : new_window : next_layout +#: # multi-key shortcuts +#: map ctrl+x>ctrl+y>z action +# kitty_mod ctrl+shift +# action_alias #: E.g. action_alias launch_tab launch --type=tab --cwd=current +#: map f1 launch_tab vim +#: map f2 launch_tab emacs + +backspace_key auto + +map alt+left neighboring_window left +map alt+right neighboring_window right +map alt+up neighboring_window up +map alt+down neighboring_window down + + +# BEGIN_KITTY_THEME +# Tokyo Night Moon +include current-theme.conf +# END_KITTY_THEME diff --git a/mc/ini b/mc/ini new file mode 100644 index 0000000..21b482a --- /dev/null +++ b/mc/ini @@ -0,0 +1,147 @@ +[Midnight-Commander] +verbose=true +shell_patterns=true +auto_save_setup=true +preallocate_space=false +auto_menu=false +use_internal_view=true +use_internal_edit=false +clear_before_exec=true +confirm_delete=true +confirm_overwrite=true +confirm_execute=false +confirm_history_cleanup=true +confirm_exit=false +confirm_directory_hotlist_delete=false +confirm_view_dir=false +safe_delete=false +safe_overwrite=false +use_8th_bit_as_meta=false +mouse_move_pages_viewer=true +mouse_close_dialog=false +fast_refresh=false +drop_menus=false +wrap_mode=true +old_esc_mode=true +cd_symlinks=true +show_all_if_ambiguous=false +use_file_to_guess_type=true +alternate_plus_minus=false +only_leading_plus_minus=true +show_output_starts_shell=false +xtree_mode=false +file_op_compute_totals=true +classic_progressbar=true +use_netrc=true +ftpfs_always_use_proxy=false +ftpfs_use_passive_connections=true +ftpfs_use_passive_connections_over_proxy=false +ftpfs_use_unix_list_options=true +ftpfs_first_cd_then_ls=true +ignore_ftp_chattr_errors=true +editor_fill_tabs_with_spaces=false +editor_return_does_auto_indent=true +editor_backspace_through_tabs=false +editor_fake_half_tabs=true +editor_option_save_position=true +editor_option_auto_para_formatting=false +editor_option_typewriter_wrap=false +editor_edit_confirm_save=true +editor_syntax_highlighting=true +editor_persistent_selections=true +editor_drop_selection_on_copy=true +editor_cursor_beyond_eol=false +editor_cursor_after_inserted_block=false +editor_visible_tabs=true +editor_visible_spaces=true +editor_line_state=false +editor_simple_statusbar=false +editor_check_new_line=false +editor_show_right_margin=false +editor_group_undo=false +editor_state_full_filename=false +editor_ask_filename_before_edit=false +nice_rotating_dash=true +shadows=true +mcview_remember_file_position=false +auto_fill_mkdir_name=true +copymove_persistent_attr=true +pause_after_run=1 +mouse_repeat_rate=100 +double_click_speed=250 +old_esc_mode_timeout=1000000 +max_dirt_limit=10 +num_history_items_recorded=60 +vfs_timeout=60 +ftpfs_directory_timeout=900 +ftpfs_retry_seconds=30 +editor_tab_spacing=8 +editor_word_wrap_line_length=72 +editor_option_save_mode=0 +editor_backup_extension=~ +editor_filesize_threshold=64M +editor_stop_format_chars=-+*\\,.;:&> +mcview_eof= +skin=dracula + +filepos_max_saved_entries=1024 +shell_directory_timeout=900 + +[Layout] +output_lines=0 +left_panel_size=93 +top_panel_size=0 +message_visible=true +keybar_visible=true +xterm_title=true +command_prompt=false +menubar_visible=true +free_space=true +horizontal_split=false +vertical_equal=true +horizontal_equal=true + +[Misc] +timeformat_recent=%b %e %H:%M +timeformat_old=%b %e %Y +ftp_proxy_host=gate +ftpfs_password=anonymous@ +display_codepage=UTF-8 +source_codepage=Other_8_bit +autodetect_codeset= +clipboard_store= +clipboard_paste= + +[Colors] +base_color= +xterm-256color= +color_terminals= + +[Panels] +show_mini_info=true +kilobyte_si=false +mix_all_files=false +show_backups=true +show_dot_files=true +fast_reload=false +fast_reload_msg_shown=false +mark_moves_down=true +reverse_files_only=true +auto_save_setup_panels=false +navigate_with_arrows=false +panel_scroll_pages=true +panel_scroll_center=false +mouse_move_pages=true +filetype_mode=true +permission_mode=false +torben_fj_mode=false +quick_search_mode=0 +select_flags=6 + +simple_swap=false + +[Panelize] +Find *.orig after patching=find . -name \\*.orig -print +Modified git files=git ls-files --modified +Find rejects after patching=find . -name \\*.rej -print +Find SUID and SGID programs=find . \\( \\( -perm -04000 -a -perm /011 \\) -o \\( -perm -02000 -a -perm /01 \\) \\) -print diff --git a/mc/panels.ini b/mc/panels.ini new file mode 100644 index 0000000..afa2cfd --- /dev/null +++ b/mc/panels.ini @@ -0,0 +1,35 @@ +[New Left Panel] +display=listing +reverse=false +case_sensitive=true +exec_first=false +sort_order=name +list_mode=full +brief_cols=2 +user_format=half type name | size | perm +user_status0=half type name | size | perm +user_status1=half type name | size | perm +user_status2=half type name | size | perm +user_status3=half type name | size | perm +user_mini_status=false +list_format=full + +[New Right Panel] +display=listing +reverse=false +case_sensitive=true +exec_first=false +sort_order=name +list_mode=full +brief_cols=2 +user_format=half type name | size | perm +user_status0=half type name | size | perm +user_status1=half type name | size | perm +user_status2=half type name | size | perm +user_status3=half type name | size | perm +user_mini_status=false +list_format=full + +[Dirs] +current_is_left=true +other_dir=/home/enrique diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..c8117c7 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,2 @@ +require "enrique.core" +require "enrique.lazy" diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..be40540 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,61 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" }, + "aerial.nvim": { "branch": "master", "commit": "fa75fd0286788c6c5a65ec46aafbfaf7b7826b74" }, + "alpha-nvim": { "branch": "main", "commit": "b6f4129302db197a7249e67a90de3f2b676de13e" }, + "auto-session": { "branch": "main", "commit": "a90aa7730efa60fdcc7e00497a8f36d94a6da709" }, + "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, + "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, + "bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "dart-tools.nvim": { "branch": "main", "commit": "34f4835d42213ab3fb85995296bf25bd0e8712fa" }, + "dracula.nvim": { "branch": "main", "commit": "3426d73411806f73b85f706b9b48123deeb0836c" }, + "dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" }, + "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, + "flutter-tools.nvim": { "branch": "main", "commit": "ea1d398f543a54ba95357c3b8bb9d6f68eaec36c" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, + "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, + "indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" }, + "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" }, + "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, + "noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" }, + "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, + "nvim-autopairs": { "branch": "master", "commit": "fd2badc24e675f947162a16c124d395bde80dbd6" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lint": { "branch": "master", "commit": "a7ce9c78a7c710c28bee56dfab10a5c0c80b7fb5" }, + "nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" }, + "nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" }, + "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, + "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, + "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, + "nvim-treesitter": { "branch": "master", "commit": "6a3c6a42a6e24414bdf337b05a84a0ea013dd155" }, + "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, + "nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" }, + "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, + "quickfixdd": { "branch": "master", "commit": "cc1adb7e7e9f4827cd655f6b1c05fadedaa87f45" }, + "substitute.nvim": { "branch": "main", "commit": "97f49d16f8eea7967d41db4f657dd63af53eeba1" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "todo-comments.nvim": { "branch": "main", "commit": "319c01b99b7a8c9ac2066bf0efd4d6ec68fef444" }, + "tokyonight.nvim": { "branch": "main", "commit": "4b386e66a9599057587c30538d5e6192e3d1c181" }, + "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, + "vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" }, + "vim-dadbod-completion": { "branch": "master", "commit": "880f7e9f2959e567c718d52550f9fae1aa07aa81" }, + "vim-dadbod-ui": { "branch": "master", "commit": "a5ff8bd69fcaf53cd24827b54492c8ce87806d18" }, + "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, + "vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }, + "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, + "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } +} diff --git a/nvim/lua/enrique/core/init.lua b/nvim/lua/enrique/core/init.lua new file mode 100644 index 0000000..e3a865a --- /dev/null +++ b/nvim/lua/enrique/core/init.lua @@ -0,0 +1,2 @@ +require("enrique.core.options") +-- require("enrique.core.keymaps") diff --git a/nvim/lua/enrique/core/keymaps.lua b/nvim/lua/enrique/core/keymaps.lua new file mode 100644 index 0000000..dfa8fd6 --- /dev/null +++ b/nvim/lua/enrique/core/keymaps.lua @@ -0,0 +1,190 @@ +-- This is a function called from the which-key plugin config +return function () + local keymap = vim.keymap + local wk = require("which-key") + -- { "", "command", desc="decription", mode="n" }, -- single command example + + wk.add({ + -- Miscellaneous + { "ii", "", desc="Exit insert mode with ii", mode="i" }, + { "", "nohl", desc="Clear search highlights", mode="n" }, + { "n", "o", desc="Add new line", mode="n" }, + { "N", "O", desc="Add new line above", mode="n" }, + { "+", "", desc="Increment number by 1", mode="n" }, + { "-", "", desc="Decrement number by 1", mode="n" }, + -- Miscellaneous + + { -- File saves and exits + mode = { "n", "v" }, + { "f", group="Saves and exits" }, + { "fw", "w!", desc = "Save current file"}, + {"fW", "wa!", desc = "Save all files"}, + {"fq", "wq!", desc = "Save and exit current file"}, + {"fQ", "wqa!", desc = "Save and exit all files"}, + {"fx", "q!", desc = "Exit file without saving"}, + {"fX", "q!", desc = "Exit session without saving"}, + }, + + { -- Window management + mode = {"n"}, + { "w", group="Window management" }, + { "wv", "v", desc="Split window vertically" }, + { "wh", "s", desc="Split window horizontally" }, + { "we", "=", desc="Make splits equal size" }, + { "wx", "close", desc="Close current split" }, + { "wt", "+", desc="Make split taller" }, + { "ws", "-", desc="Make split shorter" }, + { "wn", "<", desc="Decrease split width" }, + { "ww", ">", desc="Increase split width" }, + { "w", "", desc="Move to left split" }, + { "w", "", desc="Move to top split" }, + { "w", "", desc="Move to bottom split" }, + { "w", "", desc="Move to right split" }, + { "wm", "MaximizerToggle", desc="Maximize/minimize window" }, + { "wR", "SessionRestore", desc="Restore session" }, + { "wS", "SessionSave", desc="Save session" }, + }, + + { -- Tab management + mode = {"n"}, + { "t", group="Tab management" }, + { "to", "tabnew", desc="Open new tab" }, + { "tx", "tabclose", desc="Close current tab" }, + { "tn", "tabn", desc="Go to next tab" }, + { "tp", "tabp", desc="Go to prev tab" }, + { "tb", "tabnew %", desc="Open currtent buffer in new tab" }, + }, + + { -- Quickfix + mode = {"n"}, + { "q", group="Quickfix" }, + { "qo", "copen", desc="Open quickfix list" }, + { "qf", "cfirst", desc="Jump to first quickfix list item" }, + { "qn", "cnext", desc="Jump to next quickfix list item" }, + { "qp", "cprev", desc="Jump to prev quickfix list item" }, + { "ql", "clast", desc="Jump to last quickfix list item" }, + { "qc", "cclose", desc="Close quickfix list" }, + }, + + { -- Neotree + mode = {"n"}, + { "e", group="File tree" }, + { "ee", "Neotree toggle filesystem reveal left", desc="Toggle file tree" }, + { "ef", "Neotree focus", desc="Focus to file tree" }, + }, + + { -- Telescope + mode = {"n"}, + { "s", group="Search" }, + { "sf", "Telescope find_files", desc="Search files" }, + { "sg", "Telescope live_grep", desc="Search word (livegrep)" }, + { "sb", "Telescope buffers", desc="Search buffers" }, + { "sh", "Telescope help_tags", desc="Search help" }, + { "sk", "Telescope keymaps", desc="Search keymaps" }, + { "sw", "Telescope current_buffer_fuzzy_find", desc="Fuzzy search current buffer" }, + { "ss", "Telescope lsp_document_symbols", desc="Search LSP symbols (current buffer)" }, + { "sp", "Telescope builtin", desc="Select a telescope picker and run it" }, + { "st", function () + require("telescope.builtin").treesitter({ default_text = "" }) + end, desc="Telescope treesitter" }, + { "C", "Telescope colorscheme", desc="Change colorscheme" }, + }, + + { -- Language server + mode = {"n"}, + { "c", group="LSP & Code actions"}, + { "cc", "lua vim.lsp.buf.completion()", desc="Toggle LSP completion" }, + { "ch", "lua vim.lsp.buf.hover()", desc="Toggle LSP hover (documentation)" }, + { "cd", "lua vim.lsp.buf.definition()", desc="Go to definition" }, + { "cD", "lua vim.lsp.buf.declaration()", desc="Go to declaration" }, + { "ci", "Telescope lsp_implementations", desc="Show LSP implementations" }, + { "ct", "Telescope lsp_type_definitions", desc="Show LSP type definitions" }, + { "cy", "AerialToggle", desc="Toggle aerial symbols list" }, + { "cR", "Telescope lsp_references", desc="List all references of symbol" }, + { "cs", "lua vim.lsp.buf.signature_help()", desc="Display signature info under cursor" }, + { "cr", "lua vim.lsp.buf.rename()", desc="Rename" }, + { "cf", "lua vim.lsp.buf.format()", desc="Format current buffer" }, + { "cl", function () require("lint").try_lint() end, desc="Trigger linting for current buffer" }, + { "ca", "lua vim.lsp.buf.code_action()", desc="Code actions" }, + { "cL", "LspRestart", desc="Restart LSP" }, + }, + + { -- Diagnostics + mode = {"n"}, + { "d", group="Diagnostics" }, + { "dD", "Telescope diagnostics bufnr=0", desc="Show buffer diagnostics" }, + { "dd", "lua vim.diagnostic.open_float()", desc="Show diagnostics in floating window" }, + { "dn", "lua vim.diagnostic.goto_next()", desc="Go to next diagnostic" }, + { "dp", "lua vim.diagnostic.goto_prev()", desc="Go to prev diagnostic" }, + }, + + { -- Database + mode = {"n"}, + { "D", group="Dadbod SQL database"}, + { "Db", "DBUIToggle", desc="Toggle dadbod UI"}, + { "Da", "DBUIAddConnection", desc="Add new database connection"}, + }, + + { --Bufferline + mode = {"n"}, + { "b", group="Buffer" }, + { "bp", "BufferLineTogglePin", desc = "Toggle Pin" }, + { "bP", "BufferLineGroupClose ungrouped", desc = "Delete Non-Pinned Buffers" }, + { "bo", "BufferLineCloseOthers", desc = "Delete Other Buffers" }, + { "br", "BufferLineCloseRight", desc = "Delete Buffers to the Right" }, + { "bl", "BufferLineCloseLeft", desc = "Delete Buffers to the Left" }, + { "", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "", "BufferLineCycleNext", desc = "Next Buffer" }, + { "b", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "b", "BufferLineCycleNext", desc = "Next Buffer" }, + }, + + { -- TODO comments + mode = {"n"}, + { "t", group="TODO" }, + { "tt", "TodoTelescope", desc = "Show todos" }, + { "tn", function() require("todo-comments").jump_next() end, desc="Next todo comment" }, + { "tp", function() require("todo-comments").jump_prev() end, desc="Previous todo comment" }, + }, + + { -- Trouble + { "x", group="Trouble" }, + { "xx", "Trouble diagnostics toggle", desc = "Open/close trouble list" }, + { "xL", "Trouble loclist toggle", desc = "Open trouble location list diagnostics" }, + { + "xd", + "Trouble diagnostics toggle filter.buf=0", + desc = "Open trouble document diagnostics", + }, + { "xq", "Trouble qflist toggle", desc = "Open trouble quickfix list" }, + { + "xl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references (Trouble)", + }, + { "xt", "TodoTrouble", desc = "Open todos in trouble" }, + }, + + { -- Flutter + mode = {"n"}, + { "F", group="Flutter" }, + { "Ff", "Telescope flutter commands", desc="Show flutter commands" }, + { "Fo", "FlutterOutlineToggle", desc="Show flutter outline" }, + { "Fd", "FlutterDevices", desc="Show devices" }, + { "Fe", "FlutterEmulators", desc="Show emulators" }, + { "Fq", "FlutterQuit", desc="Quit flutter" }, + { "Fr", "FlutterReload", desc="Hot reload" }, + { "FR", "FlutterRestart", desc="Hot restart" }, + { "Fg", "FlutterPubGet", desc="Pub get" }, + { "Fc", "FlutterLogClear", desc="Clear logs" }, + { "FF", "FlutterRun", desc="Flutter run!" }, + }, + }) + -- Substitute + local substitute = require("substitute") + vim.keymap.set("n", "s", substitute.operator, { desc = "Substitute with motion" }) + vim.keymap.set("n", "ss", substitute.line, { desc = "Substitute line" }) + vim.keymap.set("n", "S", substitute.eol, { desc = "Substitute to end of line" }) + vim.keymap.set("x", "s", substitute.visual, { desc = "Substitute in visual mode" }) +end + diff --git a/nvim/lua/enrique/core/keymaps.lua.bak b/nvim/lua/enrique/core/keymaps.lua.bak new file mode 100644 index 0000000..919abc3 --- /dev/null +++ b/nvim/lua/enrique/core/keymaps.lua.bak @@ -0,0 +1,106 @@ +vim.g.mapleader = " " +local keymap = vim.keymap + +-- General keymaps +-- keymap.set("i", "jk", "", { desc = "Exit insert mode eith jk" }) +-- keymap.set("i", "ii", "", { desc = "exit insert mode with ii" }) +keymap.set("n", "", ":nohl", { desc = "Clear search highlights" }) +keymap.set("n", "n", "o", { desc = "Add new line" }) +keymap.set("n", "N", "O", { desc = "Add new line above" }) + +-- File saves and exits +-- keymap.set("n", "wq", ":wq", { desc = "save and quit" }) +-- keymap.set("n", "wqa", ":wqa", { desc = "save all and quit" }) +-- keymap.set("n", "qq", ":q!", { desc = "quit without saving" }) +-- keymap.set("n", "ww", ":w", { desc = "save" }) + +-- increment/decrement numbers +keymap.set("n", "+", "", { desc = "Incrment number by 1" }) +keymap.set("n", "-", "", { desc = "Decrment number by 1" }) + +-- Split window management +keymap.set("n", "sv", "v", { desc = "Split window vertically" }) +keymap.set("n", "sh", "s", { desc = "Split window horizontally" }) +keymap.set("n", "se", "=", { desc = "Make splits equal size" }) +keymap.set("n", "sx", "close", { desc = "Close current split" }) +keymap.set("n", "", "-", { desc = "make split window height shorter" }) +keymap.set("n", "", "+", { desc = "make split windows height taller" }) +keymap.set("n", "", "3>", { desc = "make split windows width bigger" }) +keymap.set("n", "", "3<", { desc = "make split windows width smaller" }) +keymap.set("n", "", "", { desc = "Move to left split" }) +keymap.set("n", "", "", { desc = "Move to right split" }) +keymap.set("n", "", "", { desc = "Move to top split" }) +keymap.set("n", "", "", { desc = "Move to bottom split" }) + +-- Tab management +keymap.set("n", "to", "tabnew", { desc = "Open new tab" }) -- open new tab +keymap.set("n", "tx", "tabclose", { desc = "Close current tab" }) -- close current tab +keymap.set("n", "tn", "tabn", { desc = "Go to next tab" }) -- go to next tab +keymap.set("n", "tp", "tabp", { desc = "Go to previous tab" }) -- go to previous tab +keymap.set("n", "tf", "tabnew %", { desc = "Open current buffer in new tab" }) -- move current buffer to new tab +keymap.set("n", "sm", ":MaximizerToggle", { desc = "toggle maximize tab" }) + +-- Diff keymaps +keymap.set("n", "cc", ":diffput", { desc = "put diff from current to other during diff" }) +keymap.set("n", "cj", ":diffget 1", { desc = "get diff from left (local) during merge" }) +keymap.set("n", "ck", ":diffget 3", { desc = "get diff from right (remote) during merge" }) +keymap.set("n", "cn", "]c", { desc = "next diff hunk" }) +keymap.set("n", "cp", "[c", { desc = "previous diff hunk" }) + +-- Quickfix keymaps +keymap.set("n", "qo", ":copen", { desc = "open quickfix list" }) +keymap.set("n", "qf", ":cfirst", { desc = "jump to first quickfix list item" }) +keymap.set("n", "qn", ":cnext", { desc = "jump to next quickfix list item" }) +keymap.set("n", "qp", ":cprev", { desc = "jump to prev quickfix list item" }) +keymap.set("n", "ql", ":clast", { desc = "jump to last quickfix list item" }) +keymap.set("n", "qc", ":cclose", { desc = "close quickfix list" }) + +-- Nvim-tree +keymap.set("n", "ee", ":NvimTreeToggle", { desc = "toggle file explorer" }) +keymap.set("n", "er", ":NvimTreeFocus", { desc = "toggle focus to file explorer" }) +keymap.set("n", "ef", ":NvimTreeFindFile", { desc = "find file in file explorer" }) + +-- Telescope +keymap.set("n", "ff", "Telescope find_files", { desc = "Find files" }) +keymap.set("n", "fg", "Telescope live_grep", { desc = "Live grep" }) +keymap.set("n", "fb", "Telescope buffers", { desc = "Find buffers" }) +keymap.set("n", "fh", "Telescope help_tags", { desc = "Help tags" }) +keymap.set("n", "fs", "Telescope current_buffer_fuzzy_find", { desc = "Fuzzy find current buffer" }) +keymap.set("n", "fo", "Telescope lsp_document_symbols", { desc = "Lsp document symbols" }) +keymap.set("n", "fi", "Telescope lsp_incoming_calls", { desc = "Lsp incoming calls" }) +keymap.set("n", "fm", function() + require("telescope.builtin").treesitter({ default_text = "" }) +end, { desc = "Telescope treesitter" }) + +-- LSP +keymap.set("n", "gg", "lua vim.lsp.buf.hover()") +keymap.set("n", "gd", "lua vim.lsp.buf.definition()") +keymap.set("n", "gD", "lua vim.lsp.buf.declaration()") +keymap.set("n", "gi", "lua vim.lsp.buf.implementation()") +keymap.set("n", "gt", "lua vim.lsp.buf.type_definition()") +keymap.set("n", "gr", "lua vim.lsp.buf.references()") +keymap.set("n", "gs", "lua vim.lsp.buf.signature_help()") +keymap.set("n", "rr", "lua vim.lsp.buf.rename()") +keymap.set("n", "gf", "lua vim.lsp.buf.format({async = true})") +keymap.set("v", "gf", "lua vim.lsp.buf.format({async = true})") +keymap.set("n", "ga", "lua vim.lsp.buf.code_action()") +keymap.set("n", "gl", "lua vim.diagnostic.open_float()") +keymap.set("n", "gp", "lua vim.diagnostic.goto_prev()") +keymap.set("n", "gn", "lua vim.diagnostic.goto_next()") +keymap.set("n", "tr", "lua vim.lsp.buf.document_symbol()") +keymap.set("i", "", "lua vim.lsp.buf.completion()") + +-- Database +keymap.set("n", "db", function() + vim.cmd("tabnew") + vim.cmd("DBUIToggle") +end, { desc = "Open dadbod in new tab" }) +keymap.set("n", "dt", function() + vim.cmd("DBUIToggle") +end, { desc = "Toggle dabase ui" }) +keymap.set("n", "da", function() + vim.cmd("DBUIAddConnection") +end, { desc = "Add new database connection" }) + +-- Aerial +keymap.set("n", "a", "AerialToggle!", { desc = "Toggle aerial (symbols)" }) diff --git a/nvim/lua/enrique/core/options.lua b/nvim/lua/enrique/core/options.lua new file mode 100644 index 0000000..81b6784 --- /dev/null +++ b/nvim/lua/enrique/core/options.lua @@ -0,0 +1,49 @@ +vim.cmd("let g:netrw_liststyle = 3") +local opt = vim.opt +vim.g.mapleader = " " +-- Session Management +opt.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" +vim.api.nvim_set_keymap('i', '', 'lua print(vim.inspect(require("cmp").config.window))', {noremap = true, silent = true}) +-- line nuembers +opt.relativenumber = true +opt.number = true + +-- tabs & indentation +opt.tabstop = 2 +opt.shiftwidth = 2 +opt.softtabstop = 2 +opt.expandtab = true +opt.autoindent = true + +-- search settings +opt.ignorecase = true +opt.smartcase = true + +-- backspace +opt.backspace = "indent,eol,start" + +--clipborad +opt.clipboard:append("unnamedplus") + +-- split windows +opt.splitright = true +opt.splitbelow = true + +-- other settings +opt.wrap = true +opt.cursorline = true +opt.termguicolors = true +opt.signcolumn = "yes" +opt.scrolloff = 10 +vim.diagnostic.config({ + float = { border = "rounded" }, -- add border to diagnostic popups +}) +-- opt.background = "dark" + +-- Consider - as part of keyword +opt.iskeyword:append("-") + +-- Folding +opt.foldlevel = 25 +-- opt.foldmethod = "expr" +-- opt.foldexpr = "nvim_treesitter#foldexpr()" -- Utilize Treesitter folds diff --git a/nvim/lua/enrique/lazy.lua b/nvim/lua/enrique/lazy.lua new file mode 100644 index 0000000..53a8926 --- /dev/null +++ b/nvim/lua/enrique/lazy.lua @@ -0,0 +1,22 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ { import = "enrique.plugins" }, { import = "enrique.plugins.lsp" } }, { + checker = { + enabled = true, + notify = false, + }, + change_detection = { + notify = false, + }, +}) diff --git a/nvim/lua/enrique/plugins/aerial.lua b/nvim/lua/enrique/plugins/aerial.lua new file mode 100644 index 0000000..3cd5d20 --- /dev/null +++ b/nvim/lua/enrique/plugins/aerial.lua @@ -0,0 +1,62 @@ +return { + 'stevearc/aerial.nvim', + opts = function () + require("aerial").setup({ + -- optionally use on_attach to set keymaps when aerial has attached to a buffer + on_attach = function(bufnr) + -- Jump forwards/backwards with '{' and '}' + vim.keymap.set("n", "{", "AerialPrev", { buffer = bufnr }) + vim.keymap.set("n", "}", "AerialNext", { buffer = bufnr }) + end, + max_width = { 40, 0.2 }, + backends = { "treesitter", "lsp" }, + default_direction = "float", + float = { + border = "rounded", + + -- Determines location of floating window + -- cursor - Opens float on top of the cursor + -- editor - Opens float centered in the editor + -- win - Opens float centered in the window + relative = "cursor", + + -- These control the height of the floating window. + -- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_height and max_height can be a list of mixed types. + -- min_height = {8, 0.1} means "the greater of 8 rows or 10% of total" + max_height = 0.9, + height = nil, + min_height = { 8, 0.1 }, + + override = function(conf, source_winid) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + }, + }) + -- You probably also want to set a keymap to toggle aerial + + -- require("telescope").setup({ + -- extensions = { + -- aerial = { + -- -- How to format the symbols + -- format_symbol = function(symbol_path, filetype) + -- if filetype == "json" or filetype == "yaml" then + -- return table.concat(symbol_path, ".") + -- else + -- return symbol_path[#symbol_path] + -- end + -- end, + -- -- Available modes: symbols, lines, both + -- show_columns = "both", + -- }, + -- }, + -- }) + end, + -- Optional dependencies + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons" + }, +} diff --git a/nvim/lua/enrique/plugins/alpha.lua b/nvim/lua/enrique/plugins/alpha.lua new file mode 100644 index 0000000..1606092 --- /dev/null +++ b/nvim/lua/enrique/plugins/alpha.lua @@ -0,0 +1,36 @@ +return { + "goolord/alpha-nvim", + event = "VimEnter", + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") + + -- Set header + dashboard.section.header.val = { + " ", + " โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— ", + " โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•‘ ", + " โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘ ", + " โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ ", + " โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ•โ• โ–ˆโ–ˆโ•‘ ", + " โ•šโ•โ• โ•šโ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• ", + " ", + } + + -- Set menu + dashboard.section.buttons.val = { + dashboard.button("SPC ee", "๎—พ > Toggle file explorer", ":Neotree toggle filesystem reveal left"), + dashboard.button("SPC ff", "๓ฐฑผ > Find File", "Telescope find_files"), + dashboard.button("e", "๏…› > New File", "ene"), + dashboard.button("SPC fs", "๏ข > Find Word", "Telescope live_grep"), + dashboard.button("SPC wr", "๓ฐฏ > Restore Session For Current Directory", "SessionRestore"), + dashboard.button("q", "๏— > Quit NVIM", "qa"), + } + + -- Send config to alpha + alpha.setup(dashboard.opts) + + -- Disable folding on alpha buffer + vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) + end, +} diff --git a/nvim/lua/enrique/plugins/auto-session.lua b/nvim/lua/enrique/plugins/auto-session.lua new file mode 100644 index 0000000..d91088b --- /dev/null +++ b/nvim/lua/enrique/plugins/auto-session.lua @@ -0,0 +1,16 @@ +return { + "rmagatti/auto-session", + config = function() + local auto_session = require("auto-session") + + auto_session.setup({ + auto_restore_enabled = false, + auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" }, + }) + + local keymap = vim.keymap + + keymap.set("n", "wr", "SessionRestore", { desc = "Restore session for" }) + keymap.set("n", "ws", "SessionSave", { desc = "Save session for auto session" }) + end, +} diff --git a/nvim/lua/enrique/plugins/autopairs.lua b/nvim/lua/enrique/plugins/autopairs.lua new file mode 100644 index 0000000..8ee54b3 --- /dev/null +++ b/nvim/lua/enrique/plugins/autopairs.lua @@ -0,0 +1,30 @@ +return { + "windwp/nvim-autopairs", + event = { "InsertEnter" }, + dependencies = { + "hrsh7th/nvim-cmp", + }, + config = function() + -- import nvim-autopairs + local autopairs = require("nvim-autopairs") + + -- configure autopairs + autopairs.setup({ + check_ts = true, -- enable treesitter + ts_config = { + lua = { "string" }, -- don't add pairs in lua string treesitter nodes + javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes + java = false, -- don't check treesitter on java + }, + }) + + -- import nvim-autopairs completion functionality + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + + -- import nvim-cmp plugin (completions plugin) + local cmp = require("cmp") + + -- make autopairs and completion work together + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, +} diff --git a/nvim/lua/enrique/plugins/barbecue.lua b/nvim/lua/enrique/plugins/barbecue.lua new file mode 100644 index 0000000..6cf61c2 --- /dev/null +++ b/nvim/lua/enrique/plugins/barbecue.lua @@ -0,0 +1,31 @@ +-- Display LSP-based breadcrumbs +return { + -- https://github.com/utilyre/barbecue.nvim + "utilyre/barbecue.nvim", + name = "barbecue", + version = "*", + dependencies = { + -- https://github.com/SmiteshP/nvim-navic + "SmiteshP/nvim-navic", + -- https://github.com/nvim-tree/nvim-web-devicons + "nvim-tree/nvim-web-devicons", -- optional dependency + }, + opts = { + ---@type boolean + show_dirname = false, + ---@type boolean + show_basename = false, + + symbols = { + ---Modification indicator. + ---@type string + modified = "โ—", + ---Truncation indicator. + ---@type string + ellipsis = "โ€ฆ", + ---Entry separator. + ---@type string + separator = "๎ชถ", + }, + }, +} diff --git a/nvim/lua/enrique/plugins/bigfile.lua b/nvim/lua/enrique/plugins/bigfile.lua new file mode 100644 index 0000000..2ee8ceb --- /dev/null +++ b/nvim/lua/enrique/plugins/bigfile.lua @@ -0,0 +1,12 @@ +-- Improve performance of editing big files +return { + -- https://github.com/LunarVim/bigfile.nvim + "LunarVim/bigfile.nvim", + event = "BufReadPre", + opts = { + filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB + }, + config = function(_, opts) + require("bigfile").setup(opts) + end, +} diff --git a/nvim/lua/enrique/plugins/bufferline.lua b/nvim/lua/enrique/plugins/bufferline.lua new file mode 100644 index 0000000..6862371 --- /dev/null +++ b/nvim/lua/enrique/plugins/bufferline.lua @@ -0,0 +1,28 @@ +return { + "akinsho/bufferline.nvim", + event = "VeryLazy", + opts = { + options = { + offsets = { + { + filetype = "neo-tree", + text = "Neo-tree", + highlight = "Directory", + text_align = "left", + }, + }, + indicator = { icon = " ๎น— ", style = "icon" }, + }, + }, + config = function(_, opts) + require("bufferline").setup(opts) + -- Fix bufferline when restoring a session + vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, { + callback = function() + vim.schedule(function() + pcall(nvim_bufferline) + end) + end, + }) + end, +} diff --git a/nvim/lua/enrique/plugins/cholorscheme.lua b/nvim/lua/enrique/plugins/cholorscheme.lua new file mode 100644 index 0000000..7290dc3 --- /dev/null +++ b/nvim/lua/enrique/plugins/cholorscheme.lua @@ -0,0 +1,53 @@ +return { + { + "binhtran432k/dracula.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = function() + require("dracula").setup({ + style = "default", -- The theme comes in three styles, `default`, a darker variant `soft` and `day` + transparent = true, -- Enable this to disable setting the background color + terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim + styles = { + variables = {}, + -- Background styles. Can be "dark", "transparent" or "normal" + sidebars = "transparent", -- style for sidebars, see below + floats = "normal", -- style for floating windows + }, + dim_inactive = false, -- dims inactive windows + lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold + + }) + -- vim.cmd[[colorscheme dracula]] + end + }, + + { + -- Tokio Night + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = function() + require ("tokyonight").setup({ + syle = "storm", -- storm, moon, night, day + light_style = "day", + transparent = true, + terminal_colors = true, + -- Background styles. Can be "dark", "transparent" or "normal" + styles = { + sidebars = "transparent", + floats = "normal", + }, + day_brightness = 0.9, -- Adjusts the brightness of the **Day** style + dim_inactive = false, -- dims inactive windows + lualine_bold = true, -- Lualine theme will be bold + }) + vim.cmd[[ + colorscheme tokyonight + hi CocUnusedHighlight cterm=underline gui=underline + ]] + end + } +} diff --git a/nvim/lua/enrique/plugins/comment.lua b/nvim/lua/enrique/plugins/comment.lua new file mode 100644 index 0000000..ecc93c4 --- /dev/null +++ b/nvim/lua/enrique/plugins/comment.lua @@ -0,0 +1,19 @@ +return { + "numToStr/Comment.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "JoosepAlviste/nvim-ts-context-commentstring", + }, + config = function() + -- import comment plugin safely + local comment = require("Comment") + + local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim") + + -- enable comment + comment.setup({ + -- for commenting tsx, jsx, svelte, html files + pre_hook = ts_context_commentstring.create_pre_hook(), + }) + end, +} diff --git a/nvim/lua/enrique/plugins/dadbod.lua b/nvim/lua/enrique/plugins/dadbod.lua new file mode 100644 index 0000000..607cdbe --- /dev/null +++ b/nvim/lua/enrique/plugins/dadbod.lua @@ -0,0 +1,13 @@ +return { + "kristijanhusak/vim-dadbod-ui", + dependencies = { + { "tpope/vim-dadbod" }, + { "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" } }, + }, + cmd = { + "DBUI", + "DBUIToggle", + "DBUIAddConnection", + "DBUIFindBuffer", + }, +} diff --git a/nvim/lua/enrique/plugins/dressing.lua b/nvim/lua/enrique/plugins/dressing.lua new file mode 100644 index 0000000..105f7e5 --- /dev/null +++ b/nvim/lua/enrique/plugins/dressing.lua @@ -0,0 +1,4 @@ +return { + "stevearc/dressing.nvim", + event = "VeryLazy", +} diff --git a/nvim/lua/enrique/plugins/flutter-tools.lua b/nvim/lua/enrique/plugins/flutter-tools.lua new file mode 100644 index 0000000..918ffb2 --- /dev/null +++ b/nvim/lua/enrique/plugins/flutter-tools.lua @@ -0,0 +1,32 @@ +return { + 'akinsho/flutter-tools.nvim', + lazy = false, + dependencies = { + 'nvim-lua/plenary.nvim', + 'stevearc/dressing.nvim', -- optional for vim.ui.select + }, + config = function () + require("flutter-tools").setup { + ui = { + border = "shadow", + }, + decorations = { + statusline = { + device = true, + }, + }, + closing_tags = { + prefix = "โ€ขโ€ขโ€ข ", + enabled = true, + }, + lsp = { + color = { + enabled = true, + background = true, + virtual_text = true, + virtual_text_str = "๓ฐค" + }, + }, + } + end +} diff --git a/nvim/lua/enrique/plugins/guess-indent.lua b/nvim/lua/enrique/plugins/guess-indent.lua new file mode 100644 index 0000000..4621e39 --- /dev/null +++ b/nvim/lua/enrique/plugins/guess-indent.lua @@ -0,0 +1,4 @@ +return { + 'nmac427/guess-indent.nvim', + config = function() require('guess-indent').setup {} end, +} diff --git a/nvim/lua/enrique/plugins/illuminate.lua b/nvim/lua/enrique/plugins/illuminate.lua new file mode 100644 index 0000000..f0bb2a9 --- /dev/null +++ b/nvim/lua/enrique/plugins/illuminate.lua @@ -0,0 +1,4 @@ +return { + "RRethy/vim-illuminate", + config = function(_, opts) require("illuminate").configure(opts) end, +} diff --git a/nvim/lua/enrique/plugins/indent-blankline.lua b/nvim/lua/enrique/plugins/indent-blankline.lua new file mode 100644 index 0000000..572e0bd --- /dev/null +++ b/nvim/lua/enrique/plugins/indent-blankline.lua @@ -0,0 +1,8 @@ +return { + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPre", "BufNewFile" }, + main = "ibl", + opts = { + indent = { char = "โ”Š" }, + }, +} diff --git a/nvim/lua/enrique/plugins/init.lua b/nvim/lua/enrique/plugins/init.lua new file mode 100644 index 0000000..fed56df --- /dev/null +++ b/nvim/lua/enrique/plugins/init.lua @@ -0,0 +1,4 @@ +return { + "nvim-lua/plenary.nvim", -- lua functions that many plugins use + "christoomey/vim-tmux-navigator", -- tmux & split window navigation +} diff --git a/nvim/lua/enrique/plugins/linting.lua b/nvim/lua/enrique/plugins/linting.lua new file mode 100644 index 0000000..3165e3a --- /dev/null +++ b/nvim/lua/enrique/plugins/linting.lua @@ -0,0 +1,25 @@ +return { + "mfussenegger/nvim-lint", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local lint = require("lint") + + lint.linters_by_ft = { + javascript = { "eslint_d" }, + typescript = { "eslint_d" }, + javascriptreact = { "eslint_d" }, + typescriptreact = { "eslint_d" }, + svelte = { "eslint_d" }, + -- python = { "pylint" }, + } + + local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) + + vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + group = lint_augroup, + callback = function() + lint.try_lint() + end, + }) + end, +} diff --git a/nvim/lua/enrique/plugins/lsp/lspconfig.lua b/nvim/lua/enrique/plugins/lsp/lspconfig.lua new file mode 100644 index 0000000..fc8dce4 --- /dev/null +++ b/nvim/lua/enrique/plugins/lsp/lspconfig.lua @@ -0,0 +1,124 @@ +return { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + { "antosha417/nvim-lsp-file-operations", config = true }, + { "folke/neodev.nvim", opts = {} }, + { "j-hui/fidget.nvim", tag = "legacy" }, + "RobertBrunhage/dart-tools.nvim", + }, + config = function() + local lspconfig = require("lspconfig") + local mason_lspconfig = require("mason-lspconfig") + local cmp_nvim_lsp = require("cmp_nvim_lsp") + + local keymap = vim.keymap -- for conciseness + + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf, silent = true } + + -- set keybinds + opts.desc = "Go to declaration" + keymap.set("n", "gD", "vim.lsp.buf.declaration()", opts) -- go to declaration + + opts.desc = "Show LSP definitions" + keymap.set("n", "gd", "Telescope lsp_definitions", opts) -- show lsp definitions + + opts.desc = "Smart rename" + keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename + + end, + }) + + -- used to enable autocompletion (assign to every lsp server config) + local capabilities = cmp_nvim_lsp.default_capabilities() + + -- Change the Diagnostic symbols in the sign column (gutter) + local signs = { Error = "๏— ", Warn = "๏ฑ ", Hint = "๓ฐ   ", Info = "๏š " } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + + mason_lspconfig.setup_handlers({ + -- default handler for installed servers + function(server_name) + lspconfig[server_name].setup({ + capabilities = capabilities, + }) + end, + + ["lua_ls"] = function() + -- configure lua server (with special settings) + lspconfig["lua_ls"].setup({ + capabilities = capabilities, + settings = { + Lua = { + -- make the language server recognize "vim" global + diagnostics = { + globals = { "vim" }, + }, + completion = { + callSnippet = "Replace", + }, + }, + }, + }) + end, + }) + + -- lspconfig["dcmls"].setup({ + -- capabilities = capabilities, + -- cmd = { + -- "dcm", + -- "start-server", + -- }, + -- filetypes = { "dart", "yaml" }, + -- }) + + -- lspconfig["dartls"].setup({ + -- capabilities = capabilities, + -- cmd = { + -- "dart", + -- "language-server", + -- "--protocol=lsp", + -- -- "--port=8123", + -- -- "--instrumentation-log-file=/Users/robertbrunhage/Desktop/lsp-log.txt", + -- }, + -- filetypes = { "dart" }, + -- init_options = { + -- onlyAnalyzeProjectsWithOpenFiles = false, + -- suggestFromUnimportedLibraries = true, + -- closingLabels = true, + -- outline = false, + -- flutterOutline = false, + -- }, + -- settings = { + -- dart = { + -- updateImportsOnRename = true, + -- completeFunctionCalls = true, + -- showTodos = true, + -- }, + -- }, + -- }) + + -- Tooltip for the lsp in bottom right + require("fidget").setup({}) + + -- Hot reload :) + require("dart-tools") + + -- Globally configure all LSP floating preview popups (like hover, signature help, etc) + local open_floating_preview = vim.lsp.util.open_floating_preview + function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) + opts = opts or {} + opts.border = opts.border or "rounded"-- Set border to rounded + return open_floating_preview(contents, syntax, opts, ...) + end + end, +} diff --git a/nvim/lua/enrique/plugins/lsp/lspconfig.lua.bak2 b/nvim/lua/enrique/plugins/lsp/lspconfig.lua.bak2 new file mode 100644 index 0000000..b5cb7ee --- /dev/null +++ b/nvim/lua/enrique/plugins/lsp/lspconfig.lua.bak2 @@ -0,0 +1,76 @@ +-- LSP Support +return { + -- LSP Configuration + -- https://github.com/neovim/nvim-lspconfig + "neovim/nvim-lspconfig", + event = "VeryLazy", + dependencies = { + -- LSP Management + -- https://github.com/williamboman/mason.nvim + { "williamboman/mason.nvim" }, + -- https://github.com/williamboman/mason-lspconfig.nvim + { "williamboman/mason-lspconfig.nvim" }, + + -- Useful status updates for LSP + -- https://github.com/j-hui/fidget.nvim + { "j-hui/fidget.nvim", opts = {} }, + + -- Additional lua configuration, makes nvim stuff amazing! + -- https://github.com/folke/neodev.nvim + { "folke/neodev.nvim" }, + }, + config = function() + require("mason").setup() + require("mason-lspconfig").setup({ + -- Install these LSPs automatically + ensure_installed = { + -- 'bashls', -- requires npm to be installed + -- 'cssls', -- requires npm to be installed + -- 'html', -- requires npm to be installed + "lua_ls", + -- 'jsonls', -- requires npm to be installed + "lemminx", + "marksman", + "quick_lint_js", + -- 'tsserver', -- requires npm to be installed + -- 'yamlls', -- requires npm to be installed + }, + }) + + local lspconfig = require("lspconfig") + local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() + local lsp_attach = function(client, bufnr) + -- Create your keybindings here... + end + + -- Call setup on each LSP server + require("mason-lspconfig").setup_handlers({ + function(server_name) + lspconfig[server_name].setup({ + on_attach = lsp_attach, + capabilities = lsp_capabilities, + }) + end, + }) + + -- Lua LSP settings + lspconfig.lua_ls.setup({ + settings = { + Lua = { + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + }, + }, + }) + + -- Globally configure all LSP floating preview popups (like hover, signature help, etc) + local open_floating_preview = vim.lsp.util.open_floating_preview + function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) + opts = opts or {} + opts.border = opts.border or "rounded" -- Set border to rounded + return open_floating_preview(contents, syntax, opts, ...) + end + end, +} diff --git a/nvim/lua/enrique/plugins/lsp/mason.lua b/nvim/lua/enrique/plugins/lsp/mason.lua new file mode 100644 index 0000000..14803bd --- /dev/null +++ b/nvim/lua/enrique/plugins/lsp/mason.lua @@ -0,0 +1,46 @@ +return { + "williamboman/mason.nvim", + dependencies = { + "williamboman/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + }, + config = function() + local mason = require("mason") + local mason_lspconfig = require("mason-lspconfig") + local mason_tool_installer = require("mason-tool-installer") + -- enable mason and configure icons + mason.setup({ + ui = { + icons = { + package_installed = "โœ“", + package_pending = "โžœ", + package_uninstalled = "โœ—", + }, + }, + }) + + mason_lspconfig.setup({ + -- list of servers for mason to install + ensure_installed = { + "html", + "tailwindcss", + "lua_ls", + "pyright", + "sqlls", + "bashls", + "taplo", + }, + }) + mason_tool_installer.setup({ + ensure_installed = { + "prettier", -- prettier formatter + "stylua", -- lua formatter + "isort", -- python formatter + "black", -- python formatter + "sql-formatter", + --"pylint", -- python linter + "eslint_d", -- js linter + }, + }) + end, +} diff --git a/nvim/lua/enrique/plugins/lualine.lua b/nvim/lua/enrique/plugins/lualine.lua new file mode 100644 index 0000000..734e5d7 --- /dev/null +++ b/nvim/lua/enrique/plugins/lualine.lua @@ -0,0 +1,59 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + local lualine = require("lualine") + local lazy_status = require("lazy.status") -- to configure lazy pending updates count + + lualine.setup({ + options = { + theme = "dracula", + }, + sections = { + lualine_x = { + -- { + -- require("noice").api.status.message.get_hl, + -- cond = require("noice").api.status.message.has, + -- }, + { + require("noice").api.status.command.get, + cond = require("noice").api.status.command.has, + color = { fg = "#ff9e64" }, + }, + { + require("noice").api.status.mode.get, + cond = require("noice").api.status.mode.has, + color = { fg = "#ff9e64" }, + }, + { + require("noice").api.status.search.get, + cond = require("noice").api.status.search.has, + color = { fg = "#ff9e64" }, + }, + { + lazy_status.updates, + cond = lazy_status.has_updates, + color = { fg = "#ff9e64" }, + }, + }, + lualine_c = { + { + -- Customize the filename part of lualine to be parent/filename + "filename", + file_status = true, -- Displays file status (readonly status, modified status) + newfile_status = false, -- Display new file status (new file means no write after created) + path = 4, -- 0: Just the filename + -- 1: Relative path + -- 2: Absolute path + -- 3: Absolute path, with tilde as the home directory + -- 4: Filename and parent dir, with tilde as the home directory + symbols = { + modified = "[+]", -- Text to show when the file is modified. + readonly = "[-]", -- Text to show when the file is non-modifiable or readonly. + }, + }, + }, + }, + }) + end, +} diff --git a/nvim/lua/enrique/plugins/miniicons.lua b/nvim/lua/enrique/plugins/miniicons.lua new file mode 100644 index 0000000..92615cb --- /dev/null +++ b/nvim/lua/enrique/plugins/miniicons.lua @@ -0,0 +1,4 @@ +return { + 'echasnovski/mini.icons', + version = false +} diff --git a/nvim/lua/enrique/plugins/neo-tree.lua b/nvim/lua/enrique/plugins/neo-tree.lua new file mode 100644 index 0000000..1d65830 --- /dev/null +++ b/nvim/lua/enrique/plugins/neo-tree.lua @@ -0,0 +1,21 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + }, + config = function() + require("neo-tree").setup({ + filesystem = { + filtered_items = { + visible = true, -- This is what you want: If you set this to `true`, all "hide" just mean "dimmed out" + hide_dotfiles = false, + hide_gitignored = true, + }, + }, + }) + end, +} diff --git a/nvim/lua/enrique/plugins/noice.lua b/nvim/lua/enrique/plugins/noice.lua new file mode 100644 index 0000000..387b569 --- /dev/null +++ b/nvim/lua/enrique/plugins/noice.lua @@ -0,0 +1,36 @@ +-- lazy.nvim +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + "rcarriga/nvim-notify", + }, + config = function() + require("noice").setup({ + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = true, -- add a border to hover docs and signature help + }, + }) + end, +} diff --git a/nvim/lua/enrique/plugins/nvim-cmp.lua b/nvim/lua/enrique/plugins/nvim-cmp.lua new file mode 100644 index 0000000..092489b --- /dev/null +++ b/nvim/lua/enrique/plugins/nvim-cmp.lua @@ -0,0 +1,147 @@ +-- Auto-completion / Snippets +return { + -- https://github.com/hrsh7th/nvim-cmp + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + -- Snippet engine & associated nvim-cmp source + -- https://github.com/L3MON4D3/LuaSnip + "L3MON4D3/LuaSnip", + -- https://github.com/saadparwaiz1/cmp_luasnip + "saadparwaiz1/cmp_luasnip", + + -- LSP completion capabilities + -- https://github.com/hrsh7th/cmp-nvim-lsp + "hrsh7th/cmp-nvim-lsp", + + -- Additional user-friendly snippets + -- https://github.com/rafamadriz/friendly-snippets + "rafamadriz/friendly-snippets", + -- https://github.com/hrsh7th/cmp-buffer + "hrsh7th/cmp-buffer", + -- https://github.com/hrsh7th/cmp-path + "hrsh7th/cmp-path", + -- https://github.com/hrsh7th/cmp-cmdline + "hrsh7th/cmp-cmdline", + -- sql completion + "kristijanhusak/vim-dadbod-completion", + {"onsails/lspkind.nvim", lazy = true}, + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + local lspkind = require('lspkind') + require("luasnip.loaders.from_vscode").lazy_load() + luasnip.config.setup({}) + + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + completion = { + completeopt = "menu,menuone,noinsert", + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_next_item(), -- next suggestion + [""] = cmp.mapping.select_prev_item(), -- previous suggestion + [""] = cmp.mapping.scroll_docs(-4), -- scroll backward + [""] = cmp.mapping.scroll_docs(4), -- scroll forward + [""] = cmp.mapping.complete({}), -- show completion suggestions + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + -- Tab through suggestions or when a snippet is active, tab to the next argument + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + -- cmp.select_next_item() + cmp.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }) + elseif luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + -- Tab backwards through suggestions or when a snippet is active, tab to the next argument + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = "vim-dadbod-completion" }, -- sql + { name = "nvim_lsp" }, -- lsp + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + }), + window = { + completion = { + width = 23, + max_height = 13, + border = "rounded", + winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None", + -- winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None", + }, + documentation = { + max_width = 72, + max_height = 23, + border = "rounded", + winhighlight = "Normal:CmpDoc", + }, + }, + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + local kind = require("lspkind").cmp_format({ + mode = "symbol_text", + maxwidth = 42, + ellipsis_char = "ยทยท", + -- show_labelDetails = true, + menu = ({ + buffer = "Bfr", + nvim_lsp = "LSP", + luasnip = "Snp", + nvim_lua = "Lua", + latex_symbols = "Ltx", + }) + })(entry, vim_item) + local strings = vim.split(kind.kind, "%s", { trimempty = true }) + local men = kind.menu + kind.kind = (strings[1] or "") .. " " + kind.menu = (men or "") .. " | " .. (strings[2] or "") + + return kind + end, + }, + -- formatting = { + -- format = lspkind.cmp_format({ + -- mode = "symbol_text", -- text_symbol or symbol_text + -- maxwidth = 23, + -- ellipsis_char = '..', + -- show_labelDetails = true, + -- menu = ({ + -- buffer = "[Buffer]", + -- nvim_lsp = "[LSP]", + -- luasnip = "[LuaSnip]", + -- nvim_lua = "[Lua]", + -- latex_symbols = "[Latex]", + -- }) + -- }), + -- }, + view = { + entries = {name = 'custom', selection_order = 'near_cursor' } + }, + }) + end, +} diff --git a/nvim/lua/enrique/plugins/quickfixdd.lua b/nvim/lua/enrique/plugins/quickfixdd.lua new file mode 100644 index 0000000..471e608 --- /dev/null +++ b/nvim/lua/enrique/plugins/quickfixdd.lua @@ -0,0 +1,6 @@ +-- Adds delete functionality to quickfix list (keymap dd) +return { + -- https://github.com/TamaMcGlinn/quickfixdd + "TamaMcGlinn/quickfixdd", + event = "VeryLazy", +} diff --git a/nvim/lua/enrique/plugins/substitute.lua b/nvim/lua/enrique/plugins/substitute.lua new file mode 100644 index 0000000..2a36240 --- /dev/null +++ b/nvim/lua/enrique/plugins/substitute.lua @@ -0,0 +1,8 @@ +return { + "gbprod/substitute.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local substitute = require("substitute") + substitute.setup() + end, +} diff --git a/nvim/lua/enrique/plugins/surround.lua b/nvim/lua/enrique/plugins/surround.lua new file mode 100644 index 0000000..77f5073 --- /dev/null +++ b/nvim/lua/enrique/plugins/surround.lua @@ -0,0 +1,6 @@ +return { + "kylechui/nvim-surround", + event = { "BufReadPre", "BufNewFile" }, + version = "*", -- Use for stability; omit to use `main` branch for the latest features + config = true, +} diff --git a/nvim/lua/enrique/plugins/telescope.lua b/nvim/lua/enrique/plugins/telescope.lua new file mode 100644 index 0000000..2ba9fb1 --- /dev/null +++ b/nvim/lua/enrique/plugins/telescope.lua @@ -0,0 +1,37 @@ +return { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "nvim-tree/nvim-web-devicons", + "folke/todo-comments.nvim", + }, + lazy = true, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") + require("telescope").load_extension("flutter") + telescope.setup({ + defaults = { + layout_strategy = "flex", + layout_config = { + height = 0.72, + width = 0.65, + prompt_position = "bottom", + horizontal = {preview_width=0.65}, + vertical = {preview_height=0.65}, + }, + path_display = { "smart" }, + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + [""] = actions.send_selected_to_qflist + actions.open_qflist, + }, + }, + }, + }) + telescope.load_extension("fzf") + end, +} diff --git a/nvim/lua/enrique/plugins/todo-comments.lua b/nvim/lua/enrique/plugins/todo-comments.lua new file mode 100644 index 0000000..6d36d72 --- /dev/null +++ b/nvim/lua/enrique/plugins/todo-comments.lua @@ -0,0 +1,9 @@ +return { + "folke/todo-comments.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local todo_comments = require("todo-comments") + todo_comments.setup() + end, +} diff --git a/nvim/lua/enrique/plugins/treesitter.lua b/nvim/lua/enrique/plugins/treesitter.lua new file mode 100644 index 0000000..8bfd297 --- /dev/null +++ b/nvim/lua/enrique/plugins/treesitter.lua @@ -0,0 +1,49 @@ +return { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + build = ":TSUpdate", + dependencies = { + "windwp/nvim-ts-autotag", + }, + config = function() + -- import nvim-treesitter plugin + local treesitter = require("nvim-treesitter.configs") + + -- configure treesitter + treesitter.setup({ -- enable syntax highlighting + highlight = { + enable = true, + }, + -- enable indentation + indent = { enable = true }, + -- enable autotagging (w/ nvim-ts-autotag plugin) + autotag = { + enable = true, + }, + -- ensure these language parsers are installed + auto_install = true, + ensure_installed = { + "html", + "css", + "markdown", + "markdown_inline", + "bash", + "lua", + "dockerfile", + "query", + "c", + "python", + "sql", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }) + end, +} diff --git a/nvim/lua/enrique/plugins/trouble.lua b/nvim/lua/enrique/plugins/trouble.lua new file mode 100644 index 0000000..8dc8255 --- /dev/null +++ b/nvim/lua/enrique/plugins/trouble.lua @@ -0,0 +1,22 @@ +return { + "folke/trouble.nvim", + opts = {}, + cmd = "Trouble", + -- dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" }, + keys = { + { "xx", "Trouble diagnostics toggle", desc = "Open/close trouble list" }, + { "xL", "Trouble loclist toggle", desc = "Open trouble location list diagnostics" }, + { + "xd", + "Trouble diagnostics toggle filter.buf=0", + desc = "Open trouble document diagnostics", + }, + { "xq", "Trouble qflist toggle", desc = "Open trouble quickfix list" }, + { + "xl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references (Trouble)", + }, + { "xt", "TodoTrouble", desc = "Open todos in trouble" }, + }, +} diff --git a/nvim/lua/enrique/plugins/vim-maximizer.lua b/nvim/lua/enrique/plugins/vim-maximizer.lua new file mode 100644 index 0000000..2ec30f6 --- /dev/null +++ b/nvim/lua/enrique/plugins/vim-maximizer.lua @@ -0,0 +1,3 @@ +return { + "szw/vim-maximizer", +} diff --git a/nvim/lua/enrique/plugins/which-key.lua b/nvim/lua/enrique/plugins/which-key.lua new file mode 100644 index 0000000..97b8cb3 --- /dev/null +++ b/nvim/lua/enrique/plugins/which-key.lua @@ -0,0 +1,23 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, + config = function(...) require "enrique.core.keymaps" (...) end +} + + + + diff --git a/starship.toml b/starship.toml new file mode 100644 index 0000000..9790f2a --- /dev/null +++ b/starship.toml @@ -0,0 +1,209 @@ +# Get editor completions based on the config schema +"$schema" = 'https://starship.rs/config-schema.json' + +# Inserts a blank line between shell prompts +add_newline = true + +format = """ +$conda\ +$python\ +$character""" + +right_format = """ +$username\ +$hostname\ +$directory\ +$git_branch\ +$git_state\ +$git_status\ +$cmd_duration\ +""" + +# Replace the 'โฏ' symbol in the prompt with 'โžœ' +[os] +format = '[ ๎ฝญ ]($style)' +style = 'bold white' +disabled = false + +[username] +style_root = 'bold red' +style_user = 'bold green' +format = '[$user]($style) ' +show_always = true + +[hostname] +ssh_only = true +ssh_symbol = '๐ŸŒ ' +style = 'bold dimmed green' +format = 'in [$ssh_symbol$hostname]($style) โฏ ' + +[directory] +truncation_length = 3 +style = 'bold cyan' +format = '[$path]($style)[$read_only]($read_only_style) ' +read_only = '๐Ÿ”’' +read_only_style = 'red' +truncation_symbol = '../' +home_symbol = '๏€• ' + +[conda] +symbol = 'โŠ™ ' +style = 'bold green' +format = '[ $symbol$environment](bold dimmed green) ' +ignore_base = false +disabled = false + +# โฏ +# ๎ท… +[character] +success_symbol = "[ ๓ฐŠ  ](bold )[ ๏„  ](bold green)" +error_symbol = "[ ๓ฐŠ  ](bold)[ ๏„  ](bold red)" +vimcmd_symbol = "[ ๓ฐŠ  ](bold)[ ๏„  ](bold green)" + +[git_commit] +tag_symbol = " tag " + +[git_status] +ahead = ">" +behind = "<" +diverged = "<>" +renamed = "r" +deleted = "x" + +[aws] +symbol = "aws " + +[azure] +symbol = "az " + +[bun] +symbol = "bun " + +[c] +symbol = "C " + +[cobol] +symbol = "cobol " + +[crystal] +symbol = "cr " + +[cmake] +symbol = "cmake " + +[daml] +symbol = "daml " + +[dart] +symbol = "dart " + +[deno] +symbol = "deno " + +[dotnet] +symbol = ".NET " + +[docker_context] +symbol = "docker " + +[elixir] +symbol = "exs " + +[elm] +symbol = "elm " + +[gcloud] +symbol = "gcp " + +[git_branch] +symbol = "git " + +[golang] +symbol = "go " + +[guix_shell] +symbol = "guix " + +[hg_branch] +symbol = "hg " + +[java] +symbol = "java " + +[julia] +symbol = "jl " + +[kotlin] +symbol = "kt " + +[lua] +symbol = "lua " + +[nodejs] +symbol = "nodejs " + +[memory_usage] +symbol = "memory " + +[meson] +symbol = "meson " + +[nim] +symbol = "nim " + +[nix_shell] +symbol = "nix " + +[ocaml] +symbol = "ml " + +[opa] +symbol = "opa " + +[package] +symbol = "pkg " + +[perl] +symbol = "pl " + +[php] +symbol = "php " + +[pulumi] +symbol = "pulumi " + +[purescript] +symbol = "purs " + +[python] +symbol = "py " + +[raku] +symbol = "raku " + +[ruby] +symbol = "rb " + +[rust] +symbol = "rs " + +[scala] +symbol = "scala " + +[spack] +symbol = "spack " + +[status] +symbol = "[x](bold red) " + +[sudo] +symbol = "sudo " + +[swift] +symbol = "swift " + +[terraform] +symbol = "terraform " + +[zig] +symbol = "zig " diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..01f195d --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -e + +CONFIG_DIR="$HOME/.config" + +# Function to remove symlink and restore backup if it exists +uninstall_config() { + local name=$1 + local target="$CONFIG_DIR/$name" + + # Remove symlink if it exists + if [ -L "$target" ]; then + echo "Removing $name symlink" + rm "$target" + + # Restore backup if it exists + if [ -e "${target}.bak" ]; then + echo "Restoring $name backup from ${target}.bak" + mv "${target}.bak" "$target" + fi + elif [ -e "$target" ]; then + echo "$name is not a symlink, skipping" + else + echo "$name config not found, skipping" + fi +} + +# Uninstall each config +echo "Uninstalling dotfiles..." +uninstall_config "fish" +uninstall_config "mc" +uninstall_config "nvim" +uninstall_config "kitty" + +# Uninstall starship.toml +if [ -L "$CONFIG_DIR/starship.toml" ]; then + echo "Removing starship.toml symlink" + rm "$CONFIG_DIR/starship.toml" + + # Restore backup if it exists + if [ -e "${CONFIG_DIR}/starship.toml.bak" ]; then + echo "Restoring starship.toml backup from ${CONFIG_DIR}/starship.toml.bak" + mv "${CONFIG_DIR}/starship.toml.bak" "$CONFIG_DIR/starship.toml" + fi +elif [ -e "$CONFIG_DIR/starship.toml" ]; then + echo "starship.toml is not a symlink, skipping" +else + echo "starship.toml not found, skipping" +fi + +echo "Dotfiles uninstallation complete!"