From 0bc7fab50d493dbc711241e464e09b6492858a2b Mon Sep 17 00:00:00 2001 From: wooshdude Date: Fri, 25 Oct 2024 20:05:53 -0700 Subject: [PATCH] nvim and zed --- nvim/.config/nvim/init.lua | 104 ++++++++++++++++++++++------ nvim/.config/nvim/lazy-lock.json | 2 +- nvim/.config/nvim/package-lock.json | 6 ++ starship/.config/starship.toml | 9 ++- zed/.config/zed/keymap.json | 39 +++++++++++ zed/.config/zed/settings.json | 37 ++++++++++ zsh/.zshrc | 6 +- 7 files changed, 179 insertions(+), 24 deletions(-) create mode 100644 nvim/.config/nvim/package-lock.json create mode 100644 zed/.config/zed/keymap.json create mode 100644 zed/.config/zed/settings.json diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index de9f363..b81b05e 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -3,8 +3,8 @@ -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = " " vim.g.maplocalleader = " " - vim.opt.tabstop = 4 + vim.opt.softtabstop = 4 vim.opt.shiftwidth = 4 @@ -231,24 +231,38 @@ if not vim.uv.fs_stat(lazypath) then end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath) +local colors = { + blue = "#89b4fa", + cyan = "#74c7ec", + crust = "#11111b", + white = "#cdd6f4", + red = "#f38ba8", + violet = "#cba6f7", + surface = "#313244", + base = "#1e1e2e", +} + +local bubbles_theme = { + normal = { + a = { fg = colors.crust, bg = colors.blue }, + b = { fg = colors.blue, bg = colors.surface }, + c = { fg = colors.white }, + }, + + insert = { a = { fg = colors.crust, bg = colors.green } }, + visual = { a = { fg = colors.crust, bg = colors.violet } }, + replace = { a = { fg = colors.crust, bg = colors.red } }, + + inactive = { + a = { fg = colors.white, bg = colors.crust }, + b = { fg = colors.white, bg = colors.crust }, + c = { fg = colors.white }, + }, +} + -- PLUGINS require("lazy").setup({ - { - "arminveres/md-pdf.nvim", - branch = "main", -- you can assume that main is somewhat stable until releases will be made - lazy = true, - keys = { - { - ",", - function() - require("md-pdf").convert_md_to_pdf() - end, - desc = "Markdown preview", - }, - }, - opts = {}, - }, { "MeanderingProgrammer/render-markdown.nvim", opts = {}, @@ -278,6 +292,9 @@ require("lazy").setup({ ---@type AutoSession.Config opts = { suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" }, + auto_save = true, + auto_create = true, + auto_restore = true, -- log_level = 'debug', }, }, @@ -332,7 +349,40 @@ require("lazy").setup({ { "nvim-lualine/lualine.nvim", config = function() - require("lualine").setup({}) + require("lualine").setup({ + options = { + --theme = bubbles_theme, + component_separators = "", + section_separators = { left = "", right = "" }, + }, + sections = { + lualine_a = { + { "mode", separator = { left = "", right = "" }, right_padding = 2 }, + }, + lualine_b = { + "filename", + "branch", + }, + lualine_c = { + "diagnostics", + }, + lualine_x = { "filetype" }, + lualine_y = { "progress" }, + lualine_z = { + { "location", separator = { left = "", right = "" }, left_padding = 0 }, + }, + }, + inactive_sections = { + lualine_a = { "filename" }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = { "location" }, + }, + tabline = {}, + extensions = {}, + }) end, }, { "catppuccin/nvim" }, @@ -630,6 +680,13 @@ require("lazy").setup({ local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) + -- require("lspconfig").gdscript.setup({ + -- cmd = { "nc", "localhost", "6005" }, -- Replace "localhost" if Godot is on another machine + -- filetypes = { "gd", "gdscript" }, + -- root_dir = function() + -- return vim.fn.getcwd() + -- end, + -- }) -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- @@ -641,9 +698,15 @@ require("lazy").setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, + gopls = {}, + rust_analyzer = {}, + gdtoolkit = { + cmd = { "nc", "localhost", "6005" }, + filetypes = { "gd", "gdscript" }, + root_dir = function() + return vim.fn.getcwd() + end, + }, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -652,7 +715,6 @@ require("lazy").setup({ -- But for many setups, the LSP (`tsserver`) will work just fine -- tsserver = {}, -- - lua_ls = { -- cmd = {...}, -- filetypes = { ...}, diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 6fcd6af..0c36e18 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -3,6 +3,7 @@ "auto-session": { "branch": "main", "commit": "aa01054d478c6d3efc0188cb2ed4850e9f475664" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "biscuit": { "branch": "main", "commit": "4089be2d6051c41558db55bbcc227c9d0c33bb0f" }, + "cmp-fuzzy-buffer": { "branch": "main", "commit": "ada6352bc7e3c32471ab6c08f954001870329de1" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, @@ -20,7 +21,6 @@ "mason-lspconfig.nvim": { "branch": "main", "commit": "482350b050bd413931c2cdd4857443c3da7d57cb" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "md-pdf.nvim": { "branch": "main", "commit": "0da0bf9a6e85855762c68b40019851a75543d82b" }, "mini.nvim": { "branch": "main", "commit": "8413efde2546be4dec9ea424bc6af346a14dffbe" }, "neovim": { "branch": "main", "commit": "8b1fd252255a7f2c41b4192a787ab62660b29f72" }, "nvim": { "branch": "main", "commit": "4fd72a9ab64b393c2c22b168508fd244877fec96" }, diff --git a/nvim/.config/nvim/package-lock.json b/nvim/.config/nvim/package-lock.json new file mode 100644 index 0000000..b7ea3d5 --- /dev/null +++ b/nvim/.config/nvim/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "nvim", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/starship/.config/starship.toml b/starship/.config/starship.toml index 86c98b0..2a86c3a 100644 --- a/starship/.config/starship.toml +++ b/starship/.config/starship.toml @@ -20,6 +20,7 @@ $nodejs\ $nim\ $rust\ $scala\ +$python\ [](fg:#86BBD8 bg:#06969A)\ $docker_context\ [](fg:#06969A bg:#33658A)\ @@ -104,6 +105,12 @@ symbol = " " style = "bg:#86BBD8 fg:#33658A" format = '[ $symbol ($version) ]($style)' +[python] +symbol = " " +style = "bg:#86BBD8 fg:#33658A" +format = '[ ${symbol} ${pyenv_prefix}(${version} )]($style)' +detect_extensions = [] + [gradle] style = "bg:#86BBD8 fg:#33658A" format = '[ $symbol ($version) ]($style)' @@ -134,7 +141,7 @@ style = "bg:#86BBD8 fg:#33658A" format = '[ $symbol ($version) ]($style)' [rust] -symbol = "" +symbol = " " style = "bg:#86BBD8 fg:#33658A" format = '[ $symbol ($version) ]($style)' diff --git a/zed/.config/zed/keymap.json b/zed/.config/zed/keymap.json new file mode 100644 index 0000000..a36566e --- /dev/null +++ b/zed/.config/zed/keymap.json @@ -0,0 +1,39 @@ +// Zed keymap +// +// For information on binding keys, see the Zed +// documentation: https://zed.dev/docs/key-bindings +// +// To see the default key bindings run zed: open default keymap +// from the command palette. +[ + { + "context": "Workspace", + "bindings": { + // "space space": "file_finder::Toggle" + } + }, + { + "context": "Editor && vim_mode == normal", + "bindings": { + // "j j": ["workspace::SendKeystrokes", "escape"] + "tab": "pane::ActivateNextItem", + "shift-tab": "pane::ActivatePrevItem", + "space space": "file_finder::Toggle" + } + }, + { + "context": "Editor && vim_mode == insert", + "bindings": { + "ctrl-j": "editor::ContextMenuNext", + "ctrl-k": "editor::ContextMenuPrev", + "tab": "editor::ConfirmCompletion" + } + }, + { + "context": "Editor", + "bindings": { + "ctrl-j": "menu::SelectNext", + "ctrl-k": "menu::SelectPrev" + } + } +] diff --git a/zed/.config/zed/settings.json b/zed/.config/zed/settings.json new file mode 100644 index 0000000..406defc --- /dev/null +++ b/zed/.config/zed/settings.json @@ -0,0 +1,37 @@ +// Zed settings +// +// For information on how to configure Zed, see the Zed +// documentation: https://zed.dev/docs/configuring-zed +// +// To see all of Zed's default settings without changing your +// custom settings, run zed: open default settings from the +// command palette (cmd-shift-p / ctrl-shift-p) +{ + "vim_mode": true, + "vim": { + "toggle_relative_line_numbers": true + }, + "features": { + "copilot": false, + "inline_completion_provider": "none" + }, + "show_completions_on_input": true, + "assistant": { + "version": "2", + "enabled": false + }, + "inlay_hints": { + "enabled": true, + "show_type_hints": true, + "show_parameter_hints": true, + "show_other_hints": true + }, + "show_inline_completions": true, + "ui_font_size": 16, + "buffer_font_size": 16, + "theme": { + "mode": "dark", + "light": "Catppuccin Latte", + "dark": "Catppuccin Mocha (Blur)" + } +} diff --git a/zsh/.zshrc b/zsh/.zshrc index 1413f99..701749b 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,2 +1,6 @@ -export EDITOR="/usr/bin/nvim" +export EDITOR="/usr/local/bin/nvim" +export DOTNET_ROOT="/usr/local/share/dotnet" +alias py="python3" +alias pip="python3 -m pip" +alias border="sh border" eval "$(starship init zsh)"