diff --git a/.gitignore b/.gitignore index 55acb54..9f709c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ Brewfile.lock.json +nvim/plugin/packer_* diff --git a/Brewfile b/Brewfile index 78436e1..fa38fd4 100644 --- a/Brewfile +++ b/Brewfile @@ -21,9 +21,14 @@ brew "rust" brew "hashicorp/tap/terraform-ls" brew "tmate" brew "bat" +brew "fd" +brew "tree" +brew "fsouza/prettierd/prettierd" +brew "bruno" cask "stats" cask "docker" cask "rectangle" cask "spotify" cask "keycastr" +cask "graphiql" diff --git a/coc-nvim/package.json b/coc-nvim/package.json index ba5fa90..d2d0e99 100644 --- a/coc-nvim/package.json +++ b/coc-nvim/package.json @@ -8,8 +8,9 @@ "coc-explorer": "*", "coc-html": "*", "coc-json": "*", - "coc-prettier": "*", "coc-tsserver": "*", - "coc-yaml": "*" - } -} + "coc-yaml": "*", + "coc-prettier": ">=9.3.1" + }, + "lastUpdate": 1672644168821 +} \ No newline at end of file diff --git a/com.googlecode.iterm2.plist b/com.googlecode.iterm2.plist new file mode 100644 index 0000000..04c5111 --- /dev/null +++ b/com.googlecode.iterm2.plist @@ -0,0 +1,1052 @@ + + + + + AllowClipboardAccess + + Custom Color Presets + + Gruvbox Dark + + Ansi 0 Color + + Blue Component + 0.15686274509803921 + Green Component + 0.15686274509803921 + Red Component + 0.15686274509803921 + + Ansi 1 Color + + Blue Component + 0.11372549019607843 + Green Component + 0.14117647058823529 + Red Component + 0.80000000000000004 + + Ansi 10 Color + + Blue Component + 0.14901960784313725 + Green Component + 0.73333333333333328 + Red Component + 0.72156862745098038 + + Ansi 11 Color + + Blue Component + 0.18431372549019609 + Green Component + 0.74117647058823533 + Red Component + 0.98039215686274506 + + Ansi 12 Color + + Blue Component + 0.59607843137254901 + Green Component + 0.6470588235294118 + Red Component + 0.51372549019607838 + + Ansi 13 Color + + Blue Component + 0.60784313725490191 + Green Component + 0.52549019607843139 + Red Component + 0.82745098039215681 + + Ansi 14 Color + + Blue Component + 0.48627450980392156 + Green Component + 0.75294117647058822 + Red Component + 0.55686274509803924 + + Ansi 2 Color + + Blue Component + 0.10196078431372549 + Green Component + 0.59215686274509804 + Red Component + 0.59607843137254901 + + Ansi 3 Color + + Blue Component + 0.12941176470588237 + Green Component + 0.59999999999999998 + Red Component + 0.84313725490196079 + + Ansi 4 Color + + Blue Component + 0.53333333333333333 + Green Component + 0.52156862745098043 + Red Component + 0.27058823529411763 + + Ansi 5 Color + + Blue Component + 0.52549019607843139 + Green Component + 0.3843137254901961 + Red Component + 0.69411764705882351 + + Ansi 6 Color + + Blue Component + 0.41568627450980394 + Green Component + 0.61568627450980395 + Red Component + 0.40784313725490196 + + Ansi 7 Color + + Blue Component + 0.51764705882352946 + Green Component + 0.59999999999999998 + Red Component + 0.6588235294117647 + + Ansi 8 Color + + Blue Component + 0.45490196078431372 + Green Component + 0.51372549019607838 + Red Component + 0.5725490196078431 + + Ansi 9 Color + + Blue Component + 0.20392156862745098 + Green Component + 0.28627450980392155 + Red Component + 0.98431372549019602 + + Background Color + + Blue Component + 0.15686274509803921 + Green Component + 0.15686274509803921 + Red Component + 0.15686274509803921 + + Foreground Color + + Blue Component + 0.69803921568627447 + Green Component + 0.85882352941176465 + Red Component + 0.92156862745098034 + + + + Default Bookmark Guid + E756D64B-FFAE-4ACF-9AA9-FC2ACB21AD39 + DisableFullscreenTransparency + + FlashTabBarInFullscreen + + HTMLTabTitles + + HapticFeedbackForEsc + + HideScrollbar + + HideTab + + HotkeyMigratedFromSingleToMulti + + New Bookmarks + + + ASCII Anti Aliased + + ASCII Ligatures + + Ambiguous Double Width + + Ansi 0 Color + + Blue Component + 0.15686274509803921 + Green Component + 0.15686274509803921 + Red Component + 0.15686274509803921 + + Ansi 1 Color + + Blue Component + 0.11372549019607843 + Green Component + 0.14117647058823529 + Red Component + 0.80000000000000004 + + Ansi 10 Color + + Blue Component + 0.14901960784313725 + Green Component + 0.73333333333333328 + Red Component + 0.72156862745098038 + + Ansi 11 Color + + Blue Component + 0.18431372549019609 + Green Component + 0.74117647058823533 + Red Component + 0.98039215686274506 + + Ansi 12 Color + + Blue Component + 0.59607843137254901 + Green Component + 0.6470588235294118 + Red Component + 0.51372549019607838 + + Ansi 13 Color + + Blue Component + 0.60784313725490191 + Green Component + 0.52549019607843139 + Red Component + 0.82745098039215681 + + Ansi 14 Color + + Blue Component + 0.48627450980392156 + Green Component + 0.75294117647058822 + Red Component + 0.55686274509803924 + + Ansi 15 Color + + Alpha Component + 1 + Blue Component + 0.99999994039535522 + Color Space + sRGB + Green Component + 0.99999994039535522 + Red Component + 1 + + Ansi 2 Color + + Blue Component + 0.10196078431372549 + Green Component + 0.59215686274509804 + Red Component + 0.59607843137254901 + + Ansi 3 Color + + Blue Component + 0.12941176470588237 + Green Component + 0.59999999999999998 + Red Component + 0.84313725490196079 + + Ansi 4 Color + + Blue Component + 0.53333333333333333 + Green Component + 0.52156862745098043 + Red Component + 0.27058823529411763 + + Ansi 5 Color + + Blue Component + 0.52549019607843139 + Green Component + 0.3843137254901961 + Red Component + 0.69411764705882351 + + Ansi 6 Color + + Blue Component + 0.41568627450980394 + Green Component + 0.61568627450980395 + Red Component + 0.40784313725490196 + + Ansi 7 Color + + Blue Component + 0.51764705882352946 + Green Component + 0.59999999999999998 + Red Component + 0.6588235294117647 + + Ansi 8 Color + + Blue Component + 0.45490196078431372 + Green Component + 0.51372549019607838 + Red Component + 0.5725490196078431 + + Ansi 9 Color + + Blue Component + 0.20392156862745098 + Green Component + 0.28627450980392155 + Red Component + 0.98431372549019602 + + BM Growl + + Background Color + + Blue Component + 0.15686274509803921 + Green Component + 0.15686274509803921 + Red Component + 0.15686274509803921 + + Background Image Location + + Badge Color + + Alpha Component + 0.5 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.14910027384757996 + Red Component + 1 + + Blinking Cursor + + Blur + + Bold Color + + Alpha Component + 1 + Blue Component + 0.99999994039535522 + Color Space + sRGB + Green Component + 0.99999994039535522 + Red Component + 1 + + Character Encoding + 4 + Close Sessions On End + + Columns + 80 + Command + + Cursor Color + + Alpha Component + 1 + Blue Component + 0.7807578444480896 + Color Space + sRGB + Green Component + 0.78075778484344482 + Red Component + 0.7807578444480896 + + Cursor Guide Color + + Alpha Component + 0.25 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.92681378126144409 + Red Component + 0.70214027166366577 + + Cursor Text Color + + Alpha Component + 1 + Blue Component + 0.99999994039535522 + Color Space + sRGB + Green Component + 0.99999994039535522 + Red Component + 1 + + Custom Command + No + Custom Directory + No + Default Bookmark + No + Description + Default + Disable Window Resizing + + Draw Powerline Glyphs + + Flashing Bell + + Foreground Color + + Blue Component + 0.69803921568627447 + Green Component + 0.85882352941176465 + Red Component + 0.92156862745098034 + + Guid + E756D64B-FFAE-4ACF-9AA9-FC2ACB21AD39 + Horizontal Spacing + 1 + Idle Code + 0 + Jobs to Ignore + + rlogin + ssh + slogin + telnet + + Keyboard Map + + 0x2a-0x200000 + + Action + 12 + Text + * + + 0x2b-0x200000 + + Action + 12 + Text + + + + 0x2d-0x200000 + + Action + 12 + Text + - + + 0x2d-0x40000 + + Action + 11 + Text + 0x1f + + 0x2e-0x200000 + + Action + 12 + Text + . + + 0x2f-0x200000 + + Action + 12 + Text + / + + 0x3-0x200000 + + Action + 11 + Text + 0xd + + 0x30-0x200000 + + Action + 12 + Text + 0 + + 0x31-0x200000 + + Action + 12 + Text + 1 + + 0x32-0x200000 + + Action + 12 + Text + 2 + + 0x32-0x40000 + + Action + 11 + Text + 0x00 + + 0x33-0x200000 + + Action + 12 + Text + 3 + + 0x33-0x40000 + + Action + 11 + Text + 0x1b + + 0x34-0x200000 + + Action + 12 + Text + 4 + + 0x34-0x40000 + + Action + 11 + Text + 0x1c + + 0x35-0x200000 + + Action + 12 + Text + 5 + + 0x35-0x40000 + + Action + 11 + Text + 0x1d + + 0x36-0x200000 + + Action + 12 + Text + 6 + + 0x36-0x40000 + + Action + 11 + Text + 0x1e + + 0x37-0x200000 + + Action + 12 + Text + 7 + + 0x37-0x40000 + + Action + 11 + Text + 0x1f + + 0x38-0x200000 + + Action + 12 + Text + 8 + + 0x38-0x40000 + + Action + 11 + Text + 0x7f + + 0x39-0x200000 + + Action + 12 + Text + 9 + + 0x7f-0x100000 + + Action + 11 + Text + 0x15 + + 0x7f-0x80000 + + Action + 11 + Text + 0x1b 0x7f + + 0xf700-0x220000 + + Action + 10 + Text + [1;2A + + 0xf700-0x240000 + + Action + 10 + Text + [1;5A + + 0xf700-0x260000 + + Action + 10 + Text + [1;6A + + 0xf701-0x220000 + + Action + 10 + Text + [1;2B + + 0xf701-0x240000 + + Action + 10 + Text + [1;5B + + 0xf701-0x260000 + + Action + 10 + Text + [1;6B + + 0xf702-0x220000 + + Action + 10 + Text + [1;2D + + 0xf702-0x240000 + + Action + 10 + Text + [1;5D + + 0xf702-0x260000 + + Action + 10 + Text + [1;6D + + 0xf702-0x280000 + + Action + 10 + Text + b + + 0xf702-0x300000 + + Action + 11 + Text + 0x1 + + 0xf703-0x220000 + + Action + 10 + Text + [1;2C + + 0xf703-0x240000 + + Action + 10 + Text + [1;5C + + 0xf703-0x260000 + + Action + 10 + Text + [1;6C + + 0xf703-0x280000 + + Action + 10 + Text + f + + 0xf703-0x300000 + + Action + 11 + Text + 0x5 + + 0xf704-0x20000 + + Action + 10 + Text + [1;2P + + 0xf705-0x20000 + + Action + 10 + Text + [1;2Q + + 0xf706-0x20000 + + Action + 10 + Text + [1;2R + + 0xf707-0x20000 + + Action + 10 + Text + [1;2S + + 0xf708-0x20000 + + Action + 10 + Text + [15;2~ + + 0xf709-0x20000 + + Action + 10 + Text + [17;2~ + + 0xf70a-0x20000 + + Action + 10 + Text + [18;2~ + + 0xf70b-0x20000 + + Action + 10 + Text + [19;2~ + + 0xf70c-0x20000 + + Action + 10 + Text + [20;2~ + + 0xf70d-0x20000 + + Action + 10 + Text + [21;2~ + + 0xf70e-0x20000 + + Action + 10 + Text + [23;2~ + + 0xf70f-0x20000 + + Action + 10 + Text + [24;2~ + + 0xf728-0x0 + + Action + 11 + Text + 0x4 + + 0xf728-0x80000 + + Action + 10 + Text + d + + 0xf729-0x20000 + + Action + 10 + Text + [1;2H + + 0xf729-0x40000 + + Action + 10 + Text + [1;5H + + 0xf72b-0x20000 + + Action + 10 + Text + [1;2F + + 0xf72b-0x40000 + + Action + 10 + Text + [1;5F + + 0xf739-0x0 + + Action + 13 + Text + + + + Link Color + + Alpha Component + 1 + Blue Component + 0.73422712087631226 + Color Space + sRGB + Green Component + 0.35915297269821167 + Red Component + 0.0 + + Mouse Reporting + + Name + Default + Non Ascii Font + Monaco 12 + Non-ASCII Anti Aliased + + Normal Font + FiraCodeNF-Ret 16 + Option Key Sends + 2 + Prompt Before Closing 2 + + Right Option Key Sends + 0 + Rows + 25 + Screen + -1 + Scrollback Lines + 1000 + Selected Text Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.0 + + Selection Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.86943882703781128 + Red Component + 0.75743561983108521 + + Send Code When Idle + + Shortcut + + Silence Bell + + Sync Title + + Tags + + Terminal Type + xterm-256color + Thin Strokes + 4 + Transparency + 0.0 + Unlimited Scrollback + + Use Bold Font + + Use Bright Bold + + Use Italic Font + + Use Non-ASCII Font + + Vertical Spacing + 1 + Visual Bell + + Window Type + 0 + Working Directory + /Users/llago + + + PMPrintingExpandedStateForPrint2 + + PMPrintingPanelSize + {777, 1079} + PointerActions + + Button,1,1,, + + Action + kContextMenuPointerAction + + Button,2,1,, + + Action + kPasteFromClipboardPointerAction + + Gesture,ThreeFingerSwipeDown,, + + Action + kPrevWindowPointerAction + + Gesture,ThreeFingerSwipeLeft,, + + Action + kPrevTabPointerAction + + Gesture,ThreeFingerSwipeRight,, + + Action + kNextTabPointerAction + + Gesture,ThreeFingerSwipeUp,, + + Action + kNextWindowPointerAction + + + PreserveWindowSizeWhenTabBarVisibilityChanges + + Print In Black And White + + SavePasteHistory + + SoundForEsc + + SplitPaneDimmingAmount + 0.40073649878640771 + TabStyleWithAutomaticOption + 5 + TabViewType + 0 + UseBorder + + UseTmuxStatusBar + + VisualIndicatorForEsc + + findMode_iTerm + 0 + + diff --git a/ghostty b/ghostty new file mode 100644 index 0000000..df29c4d --- /dev/null +++ b/ghostty @@ -0,0 +1,7 @@ +theme = "GruvboxDark" +font-family = "FiraCode Nerd Font" +font-size = 16 +font-feature = -liga +font-feature = -calt +font-feature = -dlig +selection-invert-fg-bg = true diff --git a/gitconfig b/gitconfig index f4c8639..99477c1 100644 --- a/gitconfig +++ b/gitconfig @@ -13,10 +13,17 @@ default = current [pull] rebase = false +[init] + defaultBranch = main [filter "lfs"] - required = true clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process -[init] - defaultBranch = main + required = true +[trace2] + eventTarget = af_unix:/Users/llago/atlassian/.canvas/telemetry/git-tracing.sock + eventBrief = true + eventNesting = 1 + configparams = custom.metacommands +[maintenance] + repo = /Users/llago/Development/atlassian/atlassian-frontend-monorepo diff --git a/init.vim b/init.vimold similarity index 100% rename from init.vim rename to init.vimold diff --git a/macos-bootstrap.sh b/macos-bootstrap.sh index 0573205..44f958d 100644 --- a/macos-bootstrap.sh +++ b/macos-bootstrap.sh @@ -8,20 +8,11 @@ if [[ ! -e /usr/local/bin/z.sh ]]; then sudo cp ./z/z.sh /usr/local/bin && rm -rf ./z fi -VIM_PLUG_FILE="${HOME}/.vim/autoload/plug.vim" -if [ ! -f "${VIM_PLUG_FILE}" ]; then - echo "==> Installing vim plug" - curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - echo " ==> Vim plugins will be installed on vim startup" -fi - -NEOVIM_PLUG_FILE="${HOME}/.local/share/nvim/site/autoload/plug.vim" -if [ ! -f "${NEOVIM_PLUG_FILE}" ]; then - echo "==> Installing neovim plug" - sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - echo "==> Neovim plugins will be installed on nvim startup" +PACKER_DIST="${HOME}/.local/share/nvim/site/pack/packer/start/packer.nvim" +if [ ! -d "${PACKER_DIST}" ]; then + echo "==> Installing Packer" + git clone --depth 1 https://github.com/wbthomason/packer.nvim\ + ~/.local/share/nvim/site/pack/packer/start/packer.nvim fi if [ ! -d "${HOME}/.oh-my-zsh" ]; then @@ -42,16 +33,14 @@ mkdir -p ~/Development echo "==> Setting up dotfiles" git remote set-url origin git@github.com:lucaslago/dotfiles.git -ln -sf $(pwd)/vimrc "${HOME}/.vimrc" - -mkdir -p "${HOME}/.config/nvim" && ln -sf $(pwd)/init.vim "${HOME}/.config/nvim/init.vim" && ln -sf $(pwd)/coc-settings.json "${HOME}/.config/nvim/coc-settings.json" - ln -sf $(pwd)/zshrc "${HOME}/.zshrc" ln -sf $(pwd)/tmux.conf "${HOME}/.tmux.conf" ln -sf $(pwd)/tmate.conf "${HOME}/.tmate.conf" ln -sf $(pwd)/gitconfig "${HOME}/.gitconfig" +ln -sf "$(pwd)/nvim" "${HOME}/.config/nvim" +ln -sf $(pwd)/ghostty "${HOME}/Library/Application Support/com.mitchellh.ghostty/config" -mkdir -p "${HOME}/.config/coc/extensions" && ln -sf $(pwd)/coc-nvim/package.json "$HOME/.config/coc/extensions/package.json" && (cd "$HOME/.config/coc/extensions" && npm install --global-style --ignore-scripts --no-bin-links --no-package-lock --only=prod) +mkdir -p "${HOME}/.config/coc/extensions" if [ ! -d "${HOME}/.tmux/plugins" ]; then echo " ==> Installing tmux plugins" @@ -59,7 +48,6 @@ if [ ! -d "${HOME}/.tmux/plugins" ]; then ${HOME}/.tmux/plugins/tpm/bin/install_plugins fi - if ! command -v graphql-lsp > /dev/null; then echo "==> Installing graphql-lsp" npm install --global graphql-language-service-cli diff --git a/nvim/after/plugin/barbecue.lua b/nvim/after/plugin/barbecue.lua new file mode 100644 index 0000000..2648b9d --- /dev/null +++ b/nvim/after/plugin/barbecue.lua @@ -0,0 +1,21 @@ +-- triggers CursorHold event faster +vim.opt.updatetime = 200 + +require("barbecue").setup({ + create_autocmd = false, -- prevent barbecue from updating itself automatically +}) + +vim.api.nvim_create_autocmd({ + "WinScrolled", -- or WinResized on NVIM-v0.9 and higher + "BufWinEnter", + "CursorHold", + "InsertLeave", + + -- include this if you have set `show_modified` to `true` + "BufModifiedSet", +}, { + group = vim.api.nvim_create_augroup("barbecue.updater", {}), + callback = function() + require("barbecue.ui").update() + end, +}) diff --git a/nvim/after/plugin/colors.lua b/nvim/after/plugin/colors.lua new file mode 100644 index 0000000..3807a83 --- /dev/null +++ b/nvim/after/plugin/colors.lua @@ -0,0 +1,3 @@ +vim.o.background = "dark" -- or "light" for light mode +-- Load the colorscheme +vim.cmd[[colorscheme gruvbox]] diff --git a/nvim/after/plugin/conform.lua b/nvim/after/plugin/conform.lua new file mode 100644 index 0000000..eb96c9d --- /dev/null +++ b/nvim/after/plugin/conform.lua @@ -0,0 +1,18 @@ +require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + -- Conform will run multiple formatters sequentially + python = { "isort", "black" }, + -- You can customize some of the format options for the filetype (:help conform.format) + rust = { "rustfmt", lsp_format = "fallback" }, + javascript = { "prettierd", stop_after_first = false }, + typescript = { "prettierd", stop_after_first = false }, + typescriptreact = { "prettierd", stop_after_first = false }, + javascriptreact = { "prettierd", stop_after_first = false }, + }, + format_on_save = { + -- These options will be passed to conform.format() + timeout_ms = 500, + lsp_format = "fallback", + }, +}) diff --git a/nvim/after/plugin/dap-ui.lua b/nvim/after/plugin/dap-ui.lua new file mode 100644 index 0000000..648a3e8 --- /dev/null +++ b/nvim/after/plugin/dap-ui.lua @@ -0,0 +1 @@ +require("dapui").setup() diff --git a/nvim/after/plugin/dap.lua b/nvim/after/plugin/dap.lua new file mode 100644 index 0000000..e69de29 diff --git a/nvim/after/plugin/fugitive.lua b/nvim/after/plugin/fugitive.lua new file mode 100644 index 0000000..6e1b92d --- /dev/null +++ b/nvim/after/plugin/fugitive.lua @@ -0,0 +1 @@ +vim.keymap.set('n', 'gs', vim.cmd.Git) diff --git a/nvim/after/plugin/harpoon.lua b/nvim/after/plugin/harpoon.lua new file mode 100644 index 0000000..915ca30 --- /dev/null +++ b/nvim/after/plugin/harpoon.lua @@ -0,0 +1,10 @@ +local mark = require('harpoon.mark') +local ui = require('harpoon.ui') + +-- vim.keymap.set('n', 'a', mark.add_file) +-- vim.keymap.set('n', '', ui.toggle_quick_menu) + +-- vim.keymap.set('n', '', function () ui.nav_file(1) end) +-- vim.keymap.set('n', '', function () ui.nav_file(2) end) +-- vim.keymap.set('n', '', function () ui.nav_file(3) end) +-- vim.keymap.set('n', '', function () ui.nav_file(4) end) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua new file mode 100644 index 0000000..04b1610 --- /dev/null +++ b/nvim/after/plugin/lsp.lua @@ -0,0 +1,96 @@ +local lsp = require("lsp-zero") + +lsp.preset("recommended") + +lsp.ensure_installed({ + 'html', + 'ts_ls', + 'eslint', + 'lua_ls', + 'rust_analyzer', + 'cssls', +}) + +-- Fix Undefined global 'vim' +lsp.configure('lua_ls', { + settings = { + Lua = { + diagnostics = { + globals = { 'vim' } + } + } + } +}) + + +local cmp = require('cmp') +local cmp_select = { behavior = cmp.SelectBehavior.Select } +local cmp_mappings = lsp.defaults.cmp_mappings({ + [''] = cmp.mapping.select_prev_item(cmp_select), + [''] = cmp.mapping.select_next_item(cmp_select), + [''] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), +}) +local cmp_sources = lsp.defaults.cmp_sources() +table.insert(cmp_sources, { name = 'nvim_lsp_signature_help' }) + +-- disable completion with tab +-- this helps with copilot setup +-- cmp_mappings[''] = nil +-- cmp_mappings[''] = nil +vim.g.copilot_no_tab_map = true +vim.api.nvim_set_keymap("i", "", 'copilot#Accept("")', { silent = true, expr = true }) + +lsp.setup_nvim_cmp({ + mapping = cmp_mappings, + sources = cmp_sources +}) + +lsp.set_preferences({ + suggest_lsp_servers = false, + sign_icons = { + error = 'E', + warn = 'W', + hint = 'H', + info = 'I' + } +}) + +lsp.on_attach(function(client, bufnr) + local opts = { buffer = bufnr, remap = false } + + -- vim.api.nvim_create_autocmd("CursorHold", { + -- buffer = bufnr, + -- callback = function() + -- local cursorHoldOpts = { + -- focusable = false, + -- close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, + -- border = 'rounded', + -- source = 'always', + -- prefix = ' ', + -- scope = 'cursor', + -- } + -- vim.diagnostic.open_float(nil, cursorHoldOpts) + -- end + -- }) + + -- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "vws", vim.lsp.buf.workspace_symbol, opts) + vim.keymap.set("n", "vd", vim.diagnostic.open_float, opts) + vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts) + vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "rr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) + vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) + vim.keymap.set("n", "gr", require('telescope.builtin').lsp_references, opts) + vim.keymap.set("n", "gi", require('telescope.builtin').lsp_implementations, opts) + vim.keymap.set("n", "gd", require('telescope.builtin').lsp_definitions, opts) +end) + +lsp.setup() + +vim.diagnostic.config({ + virtual_text = true, +}) diff --git a/nvim/after/plugin/lualine.lua b/nvim/after/plugin/lualine.lua new file mode 100644 index 0000000..05a5439 --- /dev/null +++ b/nvim/after/plugin/lualine.lua @@ -0,0 +1,6 @@ +require('lualine').setup({ + theme = 'gruvbox_dark', + sections = { + lualine_c = { 'filename', require('pomodoro').statusline } + } +}) diff --git a/nvim/after/plugin/null-ls.lua b/nvim/after/plugin/null-ls.lua new file mode 100644 index 0000000..d508fcf --- /dev/null +++ b/nvim/after/plugin/null-ls.lua @@ -0,0 +1,32 @@ +local null_ls = require("null-ls") + +local group = vim.api.nvim_create_augroup("lsp_format_on_save", { clear = false }) +local event = "BufWritePre" -- or "BufWritePost" +local async = event == "BufWritePost" + +null_ls.setup({ + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.keymap.set("n", "f", function() + vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() }) + end, { buffer = bufnr, desc = "[lsp] format" }) + + -- format on save + vim.api.nvim_clear_autocmds({ buffer = bufnr, group = group }) + vim.api.nvim_create_autocmd(event, { + buffer = bufnr, + group = group, + callback = function() + vim.lsp.buf.format({ bufnr = bufnr, async = async }) + end, + desc = "[lsp] format on save", + }) + end + + if client.supports_method("textDocument/rangeFormatting") then + vim.keymap.set("x", "f", function() + vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() }) + end, { buffer = bufnr, desc = "[lsp] format" }) + end + end, +}) diff --git a/nvim/after/plugin/nvimtree.lua b/nvim/after/plugin/nvimtree.lua new file mode 100644 index 0000000..3e2fe62 --- /dev/null +++ b/nvim/after/plugin/nvimtree.lua @@ -0,0 +1,17 @@ +-- disable netrw at the very start of your init.lua (strongly advised) +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- 24 bit colors +vim.opt.termguicolors = true + +vim.keymap.set("n", "", vim.cmd.NvimTreeToggle) +vim.keymap.set("n", "r", vim.cmd.NvimTreeRefresh) +vim.keymap.set("n", "n", vim.cmd.NvimTreeFindFile) + +require("nvim-tree").setup({ + view = { + width = 100, + side = "left", + } +}) diff --git a/nvim/after/plugin/prettier.lua b/nvim/after/plugin/prettier.lua new file mode 100644 index 0000000..fbdc6fe --- /dev/null +++ b/nvim/after/plugin/prettier.lua @@ -0,0 +1,22 @@ +local prettier = require("prettier") + +-- prettier.setup({ +-- bin = 'prettierd', -- or `'prettierd'` (v0.23.3+) +-- filetypes = { +-- "css", +-- "graphql", +-- "html", +-- "javascript", +-- "javascriptreact", +-- "json", +-- "less", +-- "markdown", +-- "scss", +-- "typescript", +-- "typescriptreact", +-- "yaml", +-- }, +-- cli_options = { +-- config_precedence = "prefer-file", +-- }, +-- }) diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua new file mode 100644 index 0000000..870748c --- /dev/null +++ b/nvim/after/plugin/telescope.lua @@ -0,0 +1,46 @@ +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'pf', builtin.git_files, {}) +vim.keymap.set('n', '', builtin.find_files, {}) +vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }); +end) + +vim.keymap.set('n', 'ag', builtin.live_grep, {}) +vim.keymap.set('n', 'b', builtin.buffers, {}) + +require('telescope').setup { + defaults = { + path_display={"truncate"}, + preview = { + filesize_limit = 1, + filesize_hook = function(filepath, bufnr, opts) + local max_bytes = 10000 + local cmd = {"head", "-c", max_bytes, filepath} + require('telescope.previewers.utils').job_maker(cmd, bufnr, opts) + end, + } + }, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + } + }, + pickers = { + buffers = { + sort_mru = true, + ignore_current_buffer = true, + }, + find_files = { + theme = 'dropdown' + }, + git_files = { + theme = 'dropdown' + } + } +} + +require('telescope').load_extension('fzf') diff --git a/nvim/after/plugin/treesitter.lua b/nvim/after/plugin/treesitter.lua new file mode 100644 index 0000000..a20417d --- /dev/null +++ b/nvim/after/plugin/treesitter.lua @@ -0,0 +1,31 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" + ensure_installed = { "c", "lua", "rust", "javascript", "typescript", "go", "vim"}, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + -- `false` will disable the whole extension + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + + -- Disable highlight in big files + disable = function(lang, buf) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + }, +} diff --git a/nvim/after/plugin/undotree.lua b/nvim/after/plugin/undotree.lua new file mode 100644 index 0000000..97bb7ab --- /dev/null +++ b/nvim/after/plugin/undotree.lua @@ -0,0 +1,2 @@ +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + diff --git a/nvim/after/plugin/whichkey.lua b/nvim/after/plugin/whichkey.lua new file mode 100644 index 0000000..e724386 --- /dev/null +++ b/nvim/after/plugin/whichkey.lua @@ -0,0 +1,5 @@ +require("which-key").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below +} diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..ae4f036 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,6 @@ +if vim.g.vscode then + -- VSCode Neovim specific stuff +else + require("llago") +end + diff --git a/nvim/lua/llago/autocmd.lua b/nvim/lua/llago/autocmd.lua new file mode 100644 index 0000000..e1d4d6f --- /dev/null +++ b/nvim/lua/llago/autocmd.lua @@ -0,0 +1,6 @@ +vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*", + callback = function(args) + require("conform").format({ bufnr = args.buf, lsp_fallback = true }) + end, +}) diff --git a/nvim/lua/llago/init.lua b/nvim/lua/llago/init.lua new file mode 100644 index 0000000..a783fca --- /dev/null +++ b/nvim/lua/llago/init.lua @@ -0,0 +1,4 @@ +require("llago.remap") +require("llago.packer") +require("llago.set") +require("llago.autocmd") diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua new file mode 100644 index 0000000..fbce0b1 --- /dev/null +++ b/nvim/lua/llago/packer.lua @@ -0,0 +1,132 @@ +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +-- File explorer +local packer_bootstrap = ensure_packer() + +return require('packer').startup(function(use) + -- Plugin manager + use 'wbthomason/packer.nvim' + -- Fuzzy finder + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.6', + requires = { + { 'nvim-lua/plenary.nvim' }, + { 'nvim-telescope/telescope-fzf-native.nvim', + run = 'make' } + } + } + -- Theme + use { "ellisonleao/gruvbox.nvim" } + use { + 'nvim-tree/nvim-tree.lua', + requires = { + 'nvim-tree/nvim-web-devicons', -- optional, for file icons + }, + } + -- Icons + -- use('kyazdani42/nvim-web-devicons') + -- Highlighting + use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) + -- AST debugger + use('nvim-treesitter/playground') + -- File navigation "favorites" + use('ThePrimeagen/harpoon') + -- Undo history + use('mbbill/undotree') + -- Git support + use('tpope/vim-fugitive') + -- LSP + use { 'VonHeikemen/lsp-zero.nvim', + requires = { + -- LSP Support + { 'neovim/nvim-lspconfig' }, + { 'williamboman/mason.nvim' }, + { 'williamboman/mason-lspconfig.nvim' }, + + -- Autocompletion + { 'hrsh7th/nvim-cmp' }, + { 'hrsh7th/cmp-buffer' }, + { 'hrsh7th/cmp-path' }, + { 'saadparwaiz1/cmp_luasnip' }, + { 'hrsh7th/cmp-nvim-lsp' }, + { 'hrsh7th/cmp-nvim-lua' }, + + -- Help signatures for function parameters in insert + { 'hrsh7th/cmp-nvim-lsp-signature-help' }, + + -- Snippets + { 'L3MON4D3/LuaSnip' }, + { 'rafamadriz/friendly-snippets' }, + } + } + + -- Status line + use { + 'nvim-lualine/lualine.nvim', + requires = { 'nvim-tree/nvim-web-devicons', opt = true } + } + + -- Language agnostic comments + use('tpope/vim-commentary') + + -- Auto insertion of closing tags + use('Raimondi/delimitMate') + + -- Keybinding previews on popup + use('folke/which-key.nvim') + + -- Debugger client + use 'mfussenegger/nvim-dap' + + -- Pomodoro + use { + 'wthollingsworth/pomodoro.nvim', + requires = 'MunifTanjim/nui.nvim' + } + + use { + 'github/copilot.vim' + } + + use('jose-elias-alvarez/null-ls.nvim') + use('MunifTanjim/prettier.nvim') + use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" } } + + -- yarn pnp support https://yarnpkg.com/getting-started/editor-sdks + use('lbrayner/vim-rzip') + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + + -- Formatter + use({ + "stevearc/conform.nvim", + config = function() + require("conform").setup() + end, + }) + + use({ + "utilyre/barbecue.nvim", + tag = "*", + requires = { + "SmiteshP/nvim-navic", + "nvim-tree/nvim-web-devicons", -- optional dependency + }, + after = "nvim-web-devicons", -- keep this if you're using NvChad + config = function() + require("barbecue").setup() + end, + }) + if packer_bootstrap then + require('packer').sync() + end +end) diff --git a/nvim/lua/llago/remap.lua b/nvim/lua/llago/remap.lua new file mode 100644 index 0000000..e63636b --- /dev/null +++ b/nvim/lua/llago/remap.lua @@ -0,0 +1,36 @@ +vim.g.mapleader = "," + +vim.keymap.set("n", "pv", vim.cmd.Ex) + +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- greatest remap ever +vim.keymap.set("x", "p", [["_dP]]) + +-- next greatest remap ever : asbjornHaland +vim.keymap.set({ "n", "v" }, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +vim.keymap.set({ "n", "v" }, "d", [["_d]]) + +vim.keymap.set("n", "Q", "") +vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +vim.keymap.set("n", "f", vim.lsp.buf.format) + +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + +vim.keymap.set("n", "+", ':exe "resize" . (winheight(0) * 3/2) ') +vim.keymap.set("n", "-", ':exe "resize" . (winheight(0) * 2/3) ') diff --git a/nvim/lua/llago/set.lua b/nvim/lua/llago/set.lua new file mode 100644 index 0000000..7d01bc1 --- /dev/null +++ b/nvim/lua/llago/set.lua @@ -0,0 +1,59 @@ +vim.opt.nu = true +--vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +-- vim.opt.colorcolumn = "120" +vim.opt.clipboard = 'unnamed' +vim.opt.cmdheight = 2 +vim.opt.hidden = true +vim.opt.textwidth = 0 +vim.opt.wrapmargin = 0 +vim.opt.linebreak = true +vim.opt.list = true +vim.opt.lazyredraw = true +vim.opt.ruler = true +-- No bells +vim.opt.visualbell = false +vim.opt.errorbells = false +-- Tab +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.softtabstop = 0 +vim.opt.shiftwidth = 2 +vim.opt.smarttab = true +vim.opt.showmatch = true +vim.opt.smartcase = true + +-- Search +vim.opt.ignorecase = true +vim.opt.hlsearch = true +vim.opt.incsearch = true +vim.opt.matchtime = 0 + + +-- Indentation +vim.opt.autoindent = true +vim.opt.smartindent = true + +-- Splits +vim.opt.splitbelow = true +vim.opt.splitright = true diff --git a/tmux.conf b/tmux.conf index 552a253..74f8f6d 100644 --- a/tmux.conf +++ b/tmux.conf @@ -59,13 +59,6 @@ set -g mouse on # don't rename windows automatically set-option -g allow-rename off -# List of plugins -# set -g @plugin 'tmux-plugins/tpm' -# set -g @plugin 'egel/tmux-gruvbox' -# set -g @plugin 'tmux-plugins/tmux-yank' -# set -g @plugin 'tmux-plugins/tmux-prefix-highlight' - - # 0 is too far from ` ;) set -g base-index 1 # Loud or quiet? @@ -113,4 +106,7 @@ set-option -g status-right "#[bg=colour237,fg=colour239 nobold, nounderscore, no set-window-option -g window-status-current-format "#[bg=colour214,fg=colour237,nobold,noitalics,nounderscore]#[bg=colour214,fg=colour239] #I #[bg=colour214,fg=colour239,bold] #W#{?window_zoomed_flag,*Z,} #[bg=colour237,fg=colour214,nobold,noitalics,nounderscore]" set-window-option -g window-status-format "#[bg=colour239,fg=colour237,noitalics]#[bg=colour239,fg=colour223] #I #[bg=colour239,fg=colour223] #W #[bg=colour237,fg=colour239,noitalics]" -# run -b '~/.tmux/plugins/tpm/tpm' +# Keep at bottom +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +run '~/.tmux/plugins/tpm/tpm' diff --git a/zshrc b/zshrc index 86d9876..2f5677d 100644 --- a/zshrc +++ b/zshrc @@ -11,6 +11,7 @@ export PATH=~/.cargo/bin:$PATH # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes ZSH_THEME="robbyrussell" +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=11' # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load @@ -65,7 +66,7 @@ ZSH_THEME="robbyrussell" # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=( - npm yarn git zsh-autosuggestions docker docker-compose docker-machine fzf node heroku aws gem zsh-syntax-highlighting tmux + npm yarn git zsh-autosuggestions docker docker-compose fzf node heroku aws gem zsh-syntax-highlighting tmux ) source $ZSH/oh-my-zsh.sh @@ -116,3 +117,21 @@ function change-mac() { . /usr/local/bin/z.sh eval "$(fnm env)" + +source ~/.afm-git-configrc + +export PATH="/Users/llago/.local/bin:$PATH" + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# Load pyenv automatically by appending +# the following to +# ~/.zprofile (for login shells) +# and ~/.zshrc (for interactive shells) : + +export PYENV_ROOT="$HOME/.pyenv" +[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init - zsh)" +