diff --git a/config/colorscheme/gruvbox.nix b/config/colorscheme/gruvbox.nix index 08494b8..bae648e 100644 --- a/config/colorscheme/gruvbox.nix +++ b/config/colorscheme/gruvbox.nix @@ -1,5 +1,5 @@ { - colorschemes.gruvbox ={ - enable = true; - }; + colorschemes.gruvbox = { + enable = true; + }; } diff --git a/config/colorscheme/onedark.nix b/config/colorscheme/onedark.nix index a92a596..b84a9f2 100644 --- a/config/colorscheme/onedark.nix +++ b/config/colorscheme/onedark.nix @@ -1,59 +1,58 @@ { - colorschemes.onedark = { - enable = true; - }; - extraConfigLua = '' - ---------------------------------- --- START custom setup for onedark ----------------------------------- --- https://github.com/navarasu/onedark.nvim -require('onedark').setup { - -- Main options -- - style = 'darker', -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light' - transparent = true, -- Show/hide background - term_colors = true, -- Change terminal color as per the selected theme style - ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden - cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu + colorschemes.onedark = { + enable = true; + }; + extraConfigLua = '' + ---------------------------------- + -- START custom setup for onedark + ---------------------------------- + -- https://github.com/navarasu/onedark.nvim + require('onedark').setup { + -- Main options -- + style = 'darker', -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light' + transparent = true, -- Show/hide background + term_colors = true, -- Change terminal color as per the selected theme style + ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden + cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu - -- toggle theme style --- - -- toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "ts" - toggle_style_key = "ts", -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "ts" - -- toggle_style_list = {'dark', 'darker', 'cool', 'deep', 'warm', 'warmer', 'light'}, -- List of styles to toggle between - toggle_style_list = {'dark', 'darker', 'cool', 'deep', 'warm', 'warmer'}, -- List of styles to toggle between + -- toggle theme style --- + -- toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "ts" + toggle_style_key = "ts", -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "ts" + -- toggle_style_list = {'dark', 'darker', 'cool', 'deep', 'warm', 'warmer', 'light'}, -- List of styles to toggle between + toggle_style_list = {'dark', 'darker', 'cool', 'deep', 'warm', 'warmer'}, -- List of styles to toggle between - -- Change code style --- - -- Options are italic, bold, underline, none - -- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold' - code_style = { - comments = 'italic', - keywords = 'none', - functions = 'none', - strings = 'none', - variables = 'none' - }, + -- Change code style --- + -- Options are italic, bold, underline, none + -- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold' + code_style = { + comments = 'italic', + keywords = 'none', + functions = 'none', + strings = 'none', + variables = 'none' + }, - -- Lualine options -- - -- lualine = { - -- transparent = true, -- lualine center bar transparency - -- }, + -- Lualine options -- + -- lualine = { + -- transparent = true, -- lualine center bar transparency + -- }, - -- Custom Highlights -- - colors = {}, -- Override default colors - highlights = {}, -- Override highlight groups - - -- Plugins Config -- - diagnostics = { - darker = true, -- darker colors for diagnostic - undercurl = true, -- use undercurl instead of underline for diagnostics - background = true, -- use background color for virtual text - }, -} - - -require('onedark').load() ----------------------------------- --- END custom setup for onedark ----------------------------------- -''; + -- Custom Highlights -- + colors = {}, -- Override default colors + highlights = {}, -- Override highlight groups + -- Plugins Config -- + diagnostics = { + darker = true, -- darker colors for diagnostic + undercurl = true, -- use undercurl instead of underline for diagnostics + background = true, -- use background color for virtual text + }, + } + + + require('onedark').load() + ---------------------------------- + -- END custom setup for onedark + ---------------------------------- + ''; } diff --git a/config/default.nix b/config/default.nix index 4b38752..7babf4a 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,30 +1,28 @@ -# The line beneath this is called `modeline`. See `:help modeline` -# vim: ts=4:sts=0:sw=0:tw=78:noet { # Import all your configuration modules here imports = [ - ./colorscheme/onedark.nix - # ./colorscheme/gruvbox.nix + ./colorscheme/onedark.nix + # ./colorscheme/gruvbox.nix - ./sets.nix - ./keymaps.nix + ./sets.nix + ./keymaps.nix - ./plugins/bufferline.nix - ./plugins/comment.nix - ./plugins/fugitive.nix - ./plugins/indent-blankline.nix - ./plugins/leap.nix - ./plugins/lualine.nix - ./plugins/nvim-tree.nix - ./plugins/sleuth.nix - ./plugins/gitsigns.nix - ./plugins/which-key.nix - ./plugins/telescope.nix - ./plugins/neorg.nix - ./plugins/treesitter.nix + ./plugins/bufferline.nix + ./plugins/comment.nix + ./plugins/fugitive.nix + ./plugins/indent-blankline.nix + ./plugins/leap.nix + ./plugins/lualine.nix + ./plugins/nvim-tree.nix + ./plugins/sleuth.nix + ./plugins/gitsigns.nix + ./plugins/which-key.nix + ./plugins/telescope.nix + ./plugins/neorg.nix + ./plugins/treesitter.nix - ./plugins/lsp/lsp.nix + ./plugins/lsp/lsp.nix - ./plugins/extra/vim-rhubarb.nix + ./plugins/extra/vim-rhubarb.nix ]; } diff --git a/config/keymaps.nix b/config/keymaps.nix index 9098a30..c8fe0ae 100644 --- a/config/keymaps.nix +++ b/config/keymaps.nix @@ -1,21 +1,22 @@ -# The line beneath this is called `modeline`. See `:help modeline` -# vim: ts=4:sts=0:sw=0:tw=78:noet { - keymaps = [ - { - # vim.keymap.set({ "n", "v" }, "\\y", '"+y', {noremap=true, silent=true}) - mode = [ "n" "v" ]; - key = "\\y"; - action = "\"+y"; - options = { - silent = true; - remap = false; - }; - } - ]; - extraConfigLua = '' - -- see ":help default-mapping" - -- vim.cmd[[unmap Y]] - vim.keymap.del( "n", "Y" ) - ''; + keymaps = [ + { + # vim.keymap.set({ "n", "v" }, "\\y", '"+y', {noremap=true, silent=true}) + mode = [ + "n" + "v" + ]; + key = "\\y"; + action = "\"+y"; + options = { + silent = true; + remap = false; + }; + } + ]; + extraConfigLua = '' + -- see ":help default-mapping" + -- vim.cmd[[unmap Y]] + vim.keymap.del( "n", "Y" ) + ''; } diff --git a/config/plugins/bufferline.nix b/config/plugins/bufferline.nix index 5d37aab..d001838 100644 --- a/config/plugins/bufferline.nix +++ b/config/plugins/bufferline.nix @@ -1,7 +1,7 @@ { - plugins = { - bufferline = { - enable = true; - }; - }; + plugins = { + bufferline = { + enable = true; + }; + }; } diff --git a/config/plugins/comment.nix b/config/plugins/comment.nix index ab39fe9..a0261b5 100644 --- a/config/plugins/comment.nix +++ b/config/plugins/comment.nix @@ -1,7 +1,7 @@ { - plugins = { - comment = { - enable = true; - }; - }; + plugins = { + comment = { + enable = true; + }; + }; } diff --git a/config/plugins/extra/vim-rhubarb.nix b/config/plugins/extra/vim-rhubarb.nix index 4341235..9e18f5a 100644 --- a/config/plugins/extra/vim-rhubarb.nix +++ b/config/plugins/extra/vim-rhubarb.nix @@ -1,6 +1,4 @@ -{ pkgs -, ...}:{ - extraPlugins = with pkgs.vimPlugins; [ - vim-rhubarb - ]; +{ pkgs, ... }: +{ + extraPlugins = with pkgs.vimPlugins; [ vim-rhubarb ]; } diff --git a/config/plugins/extra/vim-sleuth.nix b/config/plugins/extra/vim-sleuth.nix index f27a30f..9163ed0 100644 --- a/config/plugins/extra/vim-sleuth.nix +++ b/config/plugins/extra/vim-sleuth.nix @@ -1,6 +1,4 @@ -{ pkgs -, ...}:{ - extraPlugins = with pkgs.vimPlugins; [ - vim-sleuth - ]; +{ pkgs, ... }: +{ + extraPlugins = with pkgs.vimPlugins; [ vim-sleuth ]; } diff --git a/config/plugins/fugitive.nix b/config/plugins/fugitive.nix index 0e53f19..4b70904 100644 --- a/config/plugins/fugitive.nix +++ b/config/plugins/fugitive.nix @@ -1,7 +1,7 @@ { - plugins = { - fugitive = { - enable = true; - }; - }; + plugins = { + fugitive = { + enable = true; + }; + }; } diff --git a/config/plugins/gitsigns.nix b/config/plugins/gitsigns.nix index 5ef55cc..28432a7 100644 --- a/config/plugins/gitsigns.nix +++ b/config/plugins/gitsigns.nix @@ -1,7 +1,7 @@ { - plugins = { - gitsigns = { - enable = true; - }; - }; + plugins = { + gitsigns = { + enable = true; + }; + }; } diff --git a/config/plugins/indent-blankline.nix b/config/plugins/indent-blankline.nix index 823d3f6..dc09e51 100644 --- a/config/plugins/indent-blankline.nix +++ b/config/plugins/indent-blankline.nix @@ -1,11 +1,11 @@ { - plugins = { - indent-blankline = { - enable = true; - settings.indent = { - char = "▎"; - tab_char = "┊"; - }; - }; - }; + plugins = { + indent-blankline = { + enable = true; + settings.indent = { + char = "▎"; + tab_char = "┊"; + }; + }; + }; } diff --git a/config/plugins/leap.nix b/config/plugins/leap.nix index 0f669e4..e51b816 100644 --- a/config/plugins/leap.nix +++ b/config/plugins/leap.nix @@ -1,30 +1,46 @@ { - plugins.leap = { - enable = true; - addDefaultMappings = false; - }; - keymaps = [ - { - mode = [ "n" "x" "o" ]; - key = "ss"; - action = "function() require('leap').leap {} end"; - lua = true; - # action = "require('leap').leap"; - } - { - mode = [ "n" "x" "o" ]; - key = "sS"; - action = "(leap-backward-to)"; - } - { - mode = [ "n" "x" "o" ]; - key = "sx"; - action = "(leap-forward-till)"; - } - { - mode = [ "n" "x" "o" ]; - key = "sX"; - action = "(leap-backward-till)"; - } - ]; + plugins.leap = { + enable = true; + addDefaultMappings = false; + }; + keymaps = [ + { + mode = [ + "n" + "x" + "o" + ]; + key = "ss"; + action = "function() require('leap').leap {} end"; + lua = true; + # action = "require('leap').leap"; + } + { + mode = [ + "n" + "x" + "o" + ]; + key = "sS"; + action = "(leap-backward-to)"; + } + { + mode = [ + "n" + "x" + "o" + ]; + key = "sx"; + action = "(leap-forward-till)"; + } + { + mode = [ + "n" + "x" + "o" + ]; + key = "sX"; + action = "(leap-backward-till)"; + } + ]; } diff --git a/config/plugins/lsp.nix.bak b/config/plugins/lsp.nix.bak index e5d7d72..48add9c 100644 --- a/config/plugins/lsp.nix.bak +++ b/config/plugins/lsp.nix.bak @@ -1,16 +1,16 @@ { - lsp = { - enable = true; - servers = { - tsserver.enable = true; + lsp = { + enable = true; + servers = { + tsserver.enable = true; - lua-ls.enable = true; + lua-ls.enable = true; - rust-analyzer = { - enable = true; - installCargo = true; - installRustc = true; - }; - }; - }; + rust-analyzer = { + enable = true; + installCargo = true; + installRustc = true; + }; + }; + }; } diff --git a/config/plugins/lsp/lsp.nix b/config/plugins/lsp/lsp.nix index bebdcbe..0821e5b 100644 --- a/config/plugins/lsp/lsp.nix +++ b/config/plugins/lsp/lsp.nix @@ -1,220 +1,237 @@ { - plugins = { - lsp-format = { - enable = false; # Enable it if you want lsp-format integration for none-ls - }; - lsp = { - enable = true; - capabilities = "offsetEncoding = 'utf-16'"; - servers = { - texlab = { - enable = true; - # cmd = ["texlab"]; - # filetypes = ["tex" "plaintex" "bib"]; - # extraOptions = { - # settings = { - # texlab = { - # auxDirectory = "tex_aux_output"; - # rootDirectory = nil; - # build = { - # # -- forwardSearchAfter = true, - # executable = "latexmk"; - # args = [ - # "-xelatex" - # "-verbose" - # # -- "-outdir=%f_output", - # # -- "-auxdir=%f_aux", - # "-outdir=tex_aux_output" - # "-file-line-error" - # "-synctex=1" - # "-interaction=nonstopmode" - # "-pv" - # "%f" - # ]; - # isContinuous = false; - # # -- "onSave = true" failed to work properly with large files like moderncv - # # -- it would not build properly until you delete all the intermediate files - # # -- onSave = true - # }; - # # -------------------------------- - # # -- END texlab main config - # # -- if used with texmagic, disable this - # # -------------------------------- - # # --https://github.com/latex-lsp/texlab/wiki/Previewing - # # -- https://github.com/f3fora/nvim-texlabconfig - # forwardSearch = { - # executable = "zathura"; - # args = [ - # # -- This is for moving lines in nvim - # "--synctex-editor-command" - # # -- I don't know why but after switching to lazy.vim, need %%% to escape the % character, so "pgrep zathura -a" can see the % sign - # "[[nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername" - # "--synctex-forward" - # "%l:1:%f" - # "%p" - # ]; - # }; - # diagnosticsDelay = 300; - # }; - # }; - # }; - }; - clangd = {enable = true;}; - lua-ls = { - enable = true; - extraOptions = { - settings = { - Lua = { - completion = { - callSnippet = "Replace"; - }; - telemetry = { - enabled = false; - }; - hint = {enable = true;}; - }; - }; - }; - }; - nil_ls = {enable = true;}; - tsserver = { - enable = false; - filetypes = ["javascript" "javascriptreact" "typescript" "typescriptreact"]; - extraOptions = { - settings = { - javascript = { - inlayHints = { - includeInlayEnumMemberValueHints = true; - includeInlayFunctionLikeReturnTypeHints = true; - includeInlayFunctionParameterTypeHints = true; - includeInlayParameterNameHints = "all"; - includeInlayParameterNameHintsWhenArgumentMatchesName = true; - includeInlayPropertyDeclarationTypeHints = true; - includeInlayVariableTypeHints = true; - }; - }; - typescript = { - inlayHints = { - includeInlayEnumMemberValueHints = true; - includeInlayFunctionLikeReturnTypeHints = true; - includeInlayFunctionParameterTypeHints = true; - includeInlayParameterNameHints = "all"; - includeInlayParameterNameHintsWhenArgumentMatchesName = true; - includeInlayPropertyDeclarationTypeHints = true; - includeInlayVariableTypeHints = true; - }; - }; - }; - }; - }; - eslint = {enable = true;}; - pyright = {enable = true;}; - ruff-lsp = {enable = true;}; - - rust-analyzer = { - enable = true; - installCargo = true; - installRustc = true; + plugins = { + lsp-format = { + enable = false; # Enable it if you want lsp-format integration for none-ls + }; + lsp = { + enable = true; + capabilities = "offsetEncoding = 'utf-16'"; + servers = { + texlab = { + enable = true; + # cmd = ["texlab"]; + # filetypes = ["tex" "plaintex" "bib"]; + # extraOptions = { + # settings = { + # texlab = { + # auxDirectory = "tex_aux_output"; + # rootDirectory = nil; + # build = { + # # -- forwardSearchAfter = true, + # executable = "latexmk"; + # args = [ + # "-xelatex" + # "-verbose" + # # -- "-outdir=%f_output", + # # -- "-auxdir=%f_aux", + # "-outdir=tex_aux_output" + # "-file-line-error" + # "-synctex=1" + # "-interaction=nonstopmode" + # "-pv" + # "%f" + # ]; + # isContinuous = false; + # # -- "onSave = true" failed to work properly with large files like moderncv + # # -- it would not build properly until you delete all the intermediate files + # # -- onSave = true + # }; + # # -------------------------------- + # # -- END texlab main config + # # -- if used with texmagic, disable this + # # -------------------------------- + # # --https://github.com/latex-lsp/texlab/wiki/Previewing + # # -- https://github.com/f3fora/nvim-texlabconfig + # forwardSearch = { + # executable = "zathura"; + # args = [ + # # -- This is for moving lines in nvim + # "--synctex-editor-command" + # # -- I don't know why but after switching to lazy.vim, need %%% to escape the % character, so "pgrep zathura -a" can see the % sign + # "[[nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername" + # "--synctex-forward" + # "%l:1:%f" + # "%p" + # ]; + # }; + # diagnosticsDelay = 300; + # }; + # }; + # }; + }; + clangd = { + enable = true; + }; + lua-ls = { + enable = true; + extraOptions = { settings = { - checkOnSave = true; - check = { - command = "clippy"; - }; - # inlayHints = { - # enable = true; - # showParameterNames = true; - # parameterHintsPrefix = "<- "; - # otherHintsPrefix = "=> "; - # }; - procMacro = { - enable = true; + Lua = { + completion = { + callSnippet = "Replace"; + }; + telemetry = { + enabled = false; + }; + hint = { + enable = true; + }; }; }; }; }; - # keymaps = { - # silent = true; - # lspBuf = { - # gd = { - # action = "definition"; - # desc = "Goto Definition"; - # }; - # gr = { - # action = "references"; - # desc = "Goto References"; - # }; - # gD = { - # action = "declaration"; - # desc = "Goto Declaration"; - # }; - # gI = { - # action = "implementation"; - # desc = "Goto Implementation"; - # }; - # gT = { - # action = "type_definition"; - # desc = "Type Definition"; - # }; - # K = { - # action = "hover"; - # desc = "Hover"; - # }; - # "cw" = { - # action = "workspace_symbol"; - # desc = "Workspace Symbol"; - # }; - # "cr" = { - # action = "rename"; - # desc = "Rename"; - # }; - # "ca" = { - # action = "code_action"; - # desc = "Code Action"; - # }; - # "" = { - # action = "signature_help"; - # desc = "Signature Help"; - # }; - # }; - # diagnostic = { - # "cd" = { - # action = "open_float"; - # desc = "Line Diagnostics"; - # }; - # "[d" = { - # action = "goto_next"; - # desc = "Next Diagnostic"; - # }; - # "]d" = { - # action = "goto_prev"; - # desc = "Previous Diagnostic"; - # }; - # }; - # }; + nil_ls = { + enable = true; + }; + tsserver = { + enable = false; + filetypes = [ + "javascript" + "javascriptreact" + "typescript" + "typescriptreact" + ]; + extraOptions = { + settings = { + javascript = { + inlayHints = { + includeInlayEnumMemberValueHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayVariableTypeHints = true; + }; + }; + typescript = { + inlayHints = { + includeInlayEnumMemberValueHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayVariableTypeHints = true; + }; + }; + }; + }; + }; + eslint = { + enable = true; + }; + pyright = { + enable = true; + }; + ruff-lsp = { + enable = true; + }; + + rust-analyzer = { + enable = true; + installCargo = true; + installRustc = true; + settings = { + checkOnSave = true; + check = { + command = "clippy"; + }; + # inlayHints = { + # enable = true; + # showParameterNames = true; + # parameterHintsPrefix = "<- "; + # otherHintsPrefix = "=> "; + # }; + procMacro = { + enable = true; + }; + }; + }; }; + # keymaps = { + # silent = true; + # lspBuf = { + # gd = { + # action = "definition"; + # desc = "Goto Definition"; + # }; + # gr = { + # action = "references"; + # desc = "Goto References"; + # }; + # gD = { + # action = "declaration"; + # desc = "Goto Declaration"; + # }; + # gI = { + # action = "implementation"; + # desc = "Goto Implementation"; + # }; + # gT = { + # action = "type_definition"; + # desc = "Type Definition"; + # }; + # K = { + # action = "hover"; + # desc = "Hover"; + # }; + # "cw" = { + # action = "workspace_symbol"; + # desc = "Workspace Symbol"; + # }; + # "cr" = { + # action = "rename"; + # desc = "Rename"; + # }; + # "ca" = { + # action = "code_action"; + # desc = "Code Action"; + # }; + # "" = { + # action = "signature_help"; + # desc = "Signature Help"; + # }; + # }; + # diagnostic = { + # "cd" = { + # action = "open_float"; + # desc = "Line Diagnostics"; + # }; + # "[d" = { + # action = "goto_next"; + # desc = "Next Diagnostic"; + # }; + # "]d" = { + # action = "goto_prev"; + # desc = "Previous Diagnostic"; + # }; + # }; + # }; }; - extraConfigLua = '' - local _border = "rounded" + }; + extraConfigLua = '' + local _border = "rounded" - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( - vim.lsp.handlers.hover, { - border = _border - } - ) + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = _border + } + ) - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( - vim.lsp.handlers.signature_help, { - border = _border - } - ) + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = _border + } + ) - vim.diagnostic.config{ - float={border=_border} - }; + vim.diagnostic.config{ + float={border=_border} + }; - require('lspconfig.ui.windows').default_options = { - border = _border - } + require('lspconfig.ui.windows').default_options = { + border = _border + } @@ -224,88 +241,88 @@ ------------------------------- --- START texmagic, texlab ------------------------------- --- Below this one line is for texmagic only --- vim.g['tex_flavor'] = 'latex' + ------------------------------ + -- START texmagic, texlab + ------------------------------ + -- Below this one line is for texmagic only + -- vim.g['tex_flavor'] = 'latex' -require('lspconfig').texlab.setup{ - cmd = {"texlab"}, - filetypes = {"tex", "plaintex", "bib"}, - single_file_support = true, - settings = { - -- https://github.com/latex-lsp/texlab/wiki/Configuration - texlab = { - ---------------------------------- - -- START for texmagic only - ---------------------------------- - -- ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ - -- build = _G.TeXMagicBuildConfig, - -- ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ - ---------------------------------- - -- END for texmagic only - ---------------------------------- + require('lspconfig').texlab.setup{ + cmd = {"texlab"}, + filetypes = {"tex", "plaintex", "bib"}, + single_file_support = true, + settings = { + -- https://github.com/latex-lsp/texlab/wiki/Configuration + texlab = { + ---------------------------------- + -- START for texmagic only + ---------------------------------- + -- ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ + -- build = _G.TeXMagicBuildConfig, + -- ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ + ---------------------------------- + -- END for texmagic only + ---------------------------------- - -------------------------------- - -- START texlab main config - -- if used with texmagic, disable this - -------------------------------- - auxDirectory = "tex_aux_output", - rootDirectory = nil, - build = { - -- forwardSearchAfter = true, - executable = "latexmk", - args = { - "-xelatex", - "-verbose", - -- "-outdir=%f_output", - -- "-auxdir=%f_aux", - "-outdir=tex_aux_output", - "-file-line-error", - "-synctex=1", - "-interaction=nonstopmode", - "-pv", - "%f", - }, - isContinuous = false, - -- "onSave = true" failed to work properly with large files like moderncv - -- it would not build properly until you delete all the intermediate files - -- onSave = true - }, - -------------------------------- - -- END texlab main config - -- if used with texmagic, disable this - -------------------------------- - --https://github.com/latex-lsp/texlab/wiki/Previewing - -- https://github.com/f3fora/nvim-texlabconfig - forwardSearch = { - executable = "zathura", - args = { - -- This is for moving lines in nvim - '--synctex-editor-command', - -- I don't know why but after switching to lazy.vim, need %%% to escape the % character, so "pgrep zathura -a" can see the % sign - [[nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername, - '--synctex-forward', - '%l:1:%f', - '%p', - }, - }, - diagnosticsDelay = 300, - } - } -} - --- compile laTeX keymap -vim.keymap.set('n', 'l', ':TexlabBuild' ) --- forwardSearch -vim.keymap.set('n', 'k', ':TexlabForward' ) --- if lsp failed to start, start manually -vim.keymap.set('n', 'j', ':LspStart' ) - ------------------------------- --- END texmagic, texlab ------------------------------- - - ''; + -------------------------------- + -- START texlab main config + -- if used with texmagic, disable this + -------------------------------- + auxDirectory = "tex_aux_output", + rootDirectory = nil, + build = { + -- forwardSearchAfter = true, + executable = "latexmk", + args = { + "-xelatex", + "-verbose", + -- "-outdir=%f_output", + -- "-auxdir=%f_aux", + "-outdir=tex_aux_output", + "-file-line-error", + "-synctex=1", + "-interaction=nonstopmode", + "-pv", + "%f", + }, + isContinuous = false, + -- "onSave = true" failed to work properly with large files like moderncv + -- it would not build properly until you delete all the intermediate files + -- onSave = true + }, + -------------------------------- + -- END texlab main config + -- if used with texmagic, disable this + -------------------------------- + --https://github.com/latex-lsp/texlab/wiki/Previewing + -- https://github.com/f3fora/nvim-texlabconfig + forwardSearch = { + executable = "zathura", + args = { + -- This is for moving lines in nvim + '--synctex-editor-command', + -- I don't know why but after switching to lazy.vim, need %%% to escape the % character, so "pgrep zathura -a" can see the % sign + [[nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername, + '--synctex-forward', + '%l:1:%f', + '%p', + }, + }, + diagnosticsDelay = 300, + } + } + } + + -- compile laTeX keymap + vim.keymap.set('n', 'l', ':TexlabBuild' ) + -- forwardSearch + vim.keymap.set('n', 'k', ':TexlabForward' ) + -- if lsp failed to start, start manually + vim.keymap.set('n', 'j', ':LspStart' ) + + ------------------------------ + -- END texmagic, texlab + ------------------------------ + + ''; } diff --git a/config/plugins/lualine.nix b/config/plugins/lualine.nix index ea40aa9..d69ee4e 100644 --- a/config/plugins/lualine.nix +++ b/config/plugins/lualine.nix @@ -1,7 +1,7 @@ { - plugins = { - lualine = { - enable = true; - }; - }; + plugins = { + lualine = { + enable = true; + }; + }; } diff --git a/config/plugins/neorg.nix b/config/plugins/neorg.nix index 253a316..f4a71cd 100644 --- a/config/plugins/neorg.nix +++ b/config/plugins/neorg.nix @@ -1,86 +1,82 @@ -# vim: ts=4:sts=0:sw=0:noet +{ pkgs, pkgs-stable, ... }: { -pkgs -, pkgs-stable -, ... }: -{ - plugins = { - neorg = { - enable = true; - # package = pkgs-stable.vimPlugins.neorg; - package = pkgs.vimPlugins.neorg; - modules = { - "core.defaults" = {}; # -- Loads default behaviour - "core.summary" = {}; - "core.export" = {}; - "core.export.markdown" = {}; - "core.concealer" = { - config = { - folds = false; - }; - }; #-- Adds pretty icons to your documents - "core.dirman" = { - config = { - workspaces = { - n = "~/neorg/notes"; - e = "~/neorg/english"; - l = "~/neorg/letter"; - g = "~/neorg/grammar"; - p = "~/neorg/perl"; - m = "~/neorg/misc"; - # nvim = "~/.config/nvim/NeorgNvimNotes"; - }; - default_workspace = "m"; - }; - }; - "core.keybinds" = { - config = { - default_keybinds = true; - hook.__raw = '' - function(keybinds) - keybinds.unmap("norg", "i", "") - keybinds.remap_event("norg", "i", "", "core.itero.next-iteration", "") - end - ''; - }; - }; - }; - }; - }; - extraConfigLua = '' - ---------------------------------------------------- - -- START Neorg config - ---------------------------------------------------- - -- vim.api.nvim_create_autocmd({'BufEnter', 'BufWinEnter'}, { - -- pattern = '*.norg', - vim.api.nvim_create_autocmd('FileType', { - pattern = 'norg', - callback = function() - vim.opt.formatoptions:remove('r') - vim.opt.formatoptions:remove('o') - - -- https://github.com/nvim-neorg/neorg/discussions/1066 - vim.opt.conceallevel = 2 - vim.keymap.set( 'n', 'Nt', function() - if vim.opt.conceallevel:get() == 2 then - vim.opt.conceallevel = 0 - elseif vim.opt.conceallevel:get() == 0 then - vim.opt.conceallevel = 2 - end - vim.cmd('Neorg toggle-concealer') - end, { desc = 'Neorg toggle-concealer and conceallevel' }) - -- use this insteand: ['core.concealer'] = { config = { folds = false }, }, - -- vim.opt.foldlevelstart = 99 - vim.keymap.set( 'n', 'Ng', function() vim.cmd.Neorg('generate-workspace-summary') end, { desc = 'generate-workspace-summary' }) - vim.keymap.set( 'n', 'NT', function() vim.cmd.Neorg('toc') end, { desc = 'Table of Content' }) - end, - }) - vim.keymap.set( 'n', 'Nw', function() vim.api.nvim_feedkeys(':Neorg workspace ', 'n', true) end, { desc = 'Neorg workspace ' }) - vim.keymap.set( 'n', 'Ni', function() vim.cmd('Neorg index') end, { desc = 'Neorg index' }) - vim.keymap.set( 'n', 'Nr', function() vim.cmd('Neorg return') end, { desc = 'Neorg return' }) - vim.keymap.set( 'n', 'Ne', function() vim.cmd('Neorg workspace e') end, { desc = 'Neorg workspace e (neorg-english)' }) - ---------------------------------------------------- - -- END Neorg config - ---------------------------------------------------- - ''; + plugins = { + neorg = { + enable = true; + # package = pkgs-stable.vimPlugins.neorg; + package = pkgs.vimPlugins.neorg; + modules = { + "core.defaults" = { }; # -- Loads default behaviour + "core.summary" = { }; + "core.export" = { }; + "core.export.markdown" = { }; + "core.concealer" = { + config = { + folds = false; + }; + }; # -- Adds pretty icons to your documents + "core.dirman" = { + config = { + workspaces = { + n = "~/neorg/notes"; + e = "~/neorg/english"; + l = "~/neorg/letter"; + g = "~/neorg/grammar"; + p = "~/neorg/perl"; + m = "~/neorg/misc"; + # nvim = "~/.config/nvim/NeorgNvimNotes"; + }; + default_workspace = "m"; + }; + }; + "core.keybinds" = { + config = { + default_keybinds = true; + hook.__raw = '' + function(keybinds) + keybinds.unmap("norg", "i", "") + keybinds.remap_event("norg", "i", "", "core.itero.next-iteration", "") + end + ''; + }; + }; + }; + }; + }; + extraConfigLua = '' + ---------------------------------------------------- + -- START Neorg config + ---------------------------------------------------- + -- vim.api.nvim_create_autocmd({'BufEnter', 'BufWinEnter'}, { + -- pattern = '*.norg', + vim.api.nvim_create_autocmd('FileType', { + pattern = 'norg', + callback = function() + vim.opt.formatoptions:remove('r') + vim.opt.formatoptions:remove('o') + + -- https://github.com/nvim-neorg/neorg/discussions/1066 + vim.opt.conceallevel = 2 + vim.keymap.set( 'n', 'Nt', function() + if vim.opt.conceallevel:get() == 2 then + vim.opt.conceallevel = 0 + elseif vim.opt.conceallevel:get() == 0 then + vim.opt.conceallevel = 2 + end + vim.cmd('Neorg toggle-concealer') + end, { desc = 'Neorg toggle-concealer and conceallevel' }) + -- use this insteand: ['core.concealer'] = { config = { folds = false }, }, + -- vim.opt.foldlevelstart = 99 + vim.keymap.set( 'n', 'Ng', function() vim.cmd.Neorg('generate-workspace-summary') end, { desc = 'generate-workspace-summary' }) + vim.keymap.set( 'n', 'NT', function() vim.cmd.Neorg('toc') end, { desc = 'Table of Content' }) + end, + }) + vim.keymap.set( 'n', 'Nw', function() vim.api.nvim_feedkeys(':Neorg workspace ', 'n', true) end, { desc = 'Neorg workspace ' }) + vim.keymap.set( 'n', 'Ni', function() vim.cmd('Neorg index') end, { desc = 'Neorg index' }) + vim.keymap.set( 'n', 'Nr', function() vim.cmd('Neorg return') end, { desc = 'Neorg return' }) + vim.keymap.set( 'n', 'Ne', function() vim.cmd('Neorg workspace e') end, { desc = 'Neorg workspace e (neorg-english)' }) + ---------------------------------------------------- + -- END Neorg config + ---------------------------------------------------- + ''; } diff --git a/config/plugins/nvim-tree.nix b/config/plugins/nvim-tree.nix index a9a00eb..9c3c0f4 100644 --- a/config/plugins/nvim-tree.nix +++ b/config/plugins/nvim-tree.nix @@ -1,7 +1,7 @@ { - plugins = { - nvim-tree = { - enable = true; - }; - }; + plugins = { + nvim-tree = { + enable = true; + }; + }; } diff --git a/config/plugins/sleuth.nix b/config/plugins/sleuth.nix index 6aafa0f..0404dc8 100644 --- a/config/plugins/sleuth.nix +++ b/config/plugins/sleuth.nix @@ -1,7 +1,7 @@ { - plugins = { - sleuth = { - enable = true; - }; - }; + plugins = { + sleuth = { + enable = true; + }; + }; } diff --git a/config/plugins/telescope.nix b/config/plugins/telescope.nix index bd371be..bd94574 100644 --- a/config/plugins/telescope.nix +++ b/config/plugins/telescope.nix @@ -1,190 +1,190 @@ { - plugins.telescope = { - enable = true; - extensions = { - fzf-native = { - enable = true; - }; - # project-nvim = { - # enable = true; - # }; - # ui-select = { - # settings = { - # specific_opts = { - # codeactions = true; - # }; - # }; - # }; - undo = { - enable = true; - mappings = { - i = { - "" = "yank_additions"; - "" = "yank_deletions"; - "" = "restore"; - }; - n = { - "y" = "yank_additions"; - "Y" = "yank_deletions"; - "u" = "restore"; - }; - }; - }; + plugins.telescope = { + enable = true; + extensions = { + fzf-native = { + enable = true; }; - # If you'd prefer Telescope not to enter a normal-like mode when hitting escape (and instead exiting), you can map to do so via: - defaults = { + # project-nvim = { + # enable = true; + # }; + # ui-select = { + # settings = { + # specific_opts = { + # codeactions = true; + # }; + # }; + # }; + undo = { + enable = true; mappings = { i = { - "" = { - __raw = '' - function(...) - return require("telescope.actions").close(...) - end''; - }; + "" = "yank_additions"; + "" = "yank_deletions"; + "" = "restore"; + }; + n = { + "y" = "yank_additions"; + "Y" = "yank_deletions"; + "u" = "restore"; }; - }; - }; - keymaps = { - "" = { - action = "find_files, {}"; - desc = "Find project files"; - }; - "/" = { - action = "live_grep"; - desc = "Grep (root dir)"; - }; - ":" = { - action = "command_history, {}"; - desc = "Command History"; - }; - "b" = { - action = "buffers, {}"; - desc = "+buffer"; - }; - "ff" = { - action = "find_files, {}"; - desc = "Find project files"; - }; - "fr" = { - action = "oldfiles, {}"; - desc = "Recent"; - }; - "fb" = { - action = "buffers, {}"; - desc = "Buffers"; - }; - "" = { - action = "git_files, {}"; - desc = "Search git files"; - }; - "gc" = { - action = "git_commits, {}"; - desc = "Commits"; - }; - "gs" = { - action = "git_status, {}"; - desc = "Status"; - }; - "sa" = { - action = "autocommands, {}"; - desc = "Auto Commands"; - }; - "sb" = { - action = "current_buffer_fuzzy_find, {}"; - desc = "Buffer"; - }; - "sc" = { - action = "command_history, {}"; - desc = "Command History"; - }; - "sC" = { - action = "commands, {}"; - desc = "Commands"; - }; - "sD" = { - action = "diagnostics, {}"; - desc = "Workspace diagnostics"; - }; - "sh" = { - action = "help_tags, {}"; - desc = "Help pages"; - }; - "sH" = { - action = "highlights, {}"; - desc = "Search Highlight Groups"; - }; - "sk" = { - action = "keymaps, {}"; - desc = "Keymaps"; - }; - "sM" = { - action = "man_pages, {}"; - desc = "Man pages"; - }; - "sm" = { - action = "marks, {}"; - desc = "Jump to Mark"; - }; - "so" = { - action = "vim_options, {}"; - desc = "Options"; - }; - "sR" = { - action = "resume, {}"; - desc = "Resume"; - }; - "uC" = { - action = "colorscheme, {}"; - desc = "Colorscheme preview"; }; }; }; - keymaps = [ - { - mode = "n"; - key = "fp"; - action = "Telescope projects"; - options = { - desc = "Projects"; + # If you'd prefer Telescope not to enter a normal-like mode when hitting escape (and instead exiting), you can map to do so via: + defaults = { + mappings = { + i = { + "" = { + __raw = '' + function(...) + return require("telescope.actions").close(...) + end''; + }; }; - } + }; + }; + keymaps = { + "" = { + action = "find_files, {}"; + desc = "Find project files"; + }; + "/" = { + action = "live_grep"; + desc = "Grep (root dir)"; + }; + ":" = { + action = "command_history, {}"; + desc = "Command History"; + }; + "b" = { + action = "buffers, {}"; + desc = "+buffer"; + }; + "ff" = { + action = "find_files, {}"; + desc = "Find project files"; + }; + "fr" = { + action = "oldfiles, {}"; + desc = "Recent"; + }; + "fb" = { + action = "buffers, {}"; + desc = "Buffers"; + }; + "" = { + action = "git_files, {}"; + desc = "Search git files"; + }; + "gc" = { + action = "git_commits, {}"; + desc = "Commits"; + }; + "gs" = { + action = "git_status, {}"; + desc = "Status"; + }; + "sa" = { + action = "autocommands, {}"; + desc = "Auto Commands"; + }; + "sb" = { + action = "current_buffer_fuzzy_find, {}"; + desc = "Buffer"; + }; + "sc" = { + action = "command_history, {}"; + desc = "Command History"; + }; + "sC" = { + action = "commands, {}"; + desc = "Commands"; + }; + "sD" = { + action = "diagnostics, {}"; + desc = "Workspace diagnostics"; + }; + "sh" = { + action = "help_tags, {}"; + desc = "Help pages"; + }; + "sH" = { + action = "highlights, {}"; + desc = "Search Highlight Groups"; + }; + "sk" = { + action = "keymaps, {}"; + desc = "Keymaps"; + }; + "sM" = { + action = "man_pages, {}"; + desc = "Man pages"; + }; + "sm" = { + action = "marks, {}"; + desc = "Jump to Mark"; + }; + "so" = { + action = "vim_options, {}"; + desc = "Options"; + }; + "sR" = { + action = "resume, {}"; + desc = "Resume"; + }; + "uC" = { + action = "colorscheme, {}"; + desc = "Colorscheme preview"; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "fp"; + action = "Telescope projects"; + options = { + desc = "Projects"; + }; + } - { - mode = "n"; - key = "sd"; - action = "Telescope diagnostics bufnr=0"; - options = { - desc = "Document diagnostics"; - }; - } + { + mode = "n"; + key = "sd"; + action = "Telescope diagnostics bufnr=0"; + options = { + desc = "Document diagnostics"; + }; + } - { - mode = "n"; - key = "st"; - action = "TodoTelescope"; - options = { - silent = true; - desc = "Todo (Telescope)"; - }; - } + { + mode = "n"; + key = "st"; + action = "TodoTelescope"; + options = { + silent = true; + desc = "Todo (Telescope)"; + }; + } - # { - # mode = "n"; - # key = ","; - # action = "Telescope buffers sort_mru=true sort_lastused=true"; - # options = { - # desc = "Switch Buffer"; - # }; - # } - ]; - extraConfigLua = '' - local telescope = require('telescope') - telescope.setup{ - pickers = { - colorscheme = { - enable_preview = true - } + # { + # mode = "n"; + # key = ","; + # action = "Telescope buffers sort_mru=true sort_lastused=true"; + # options = { + # desc = "Switch Buffer"; + # }; + # } + ]; + extraConfigLua = '' + local telescope = require('telescope') + telescope.setup{ + pickers = { + colorscheme = { + enable_preview = true } - } - ''; + } + } + ''; } diff --git a/config/plugins/treesitter.nix b/config/plugins/treesitter.nix index e2b8153..60d0a95 100644 --- a/config/plugins/treesitter.nix +++ b/config/plugins/treesitter.nix @@ -1,16 +1,16 @@ { - plugins = { - treesitter = { - enable = true; - incrementalSelection = { - enable = true; - keymaps = { - initSelection = "g"; - nodeIncremental = "g"; - scopeIncremental = ""; - nodeDecremental = "gm"; - }; - }; - }; - }; + plugins = { + treesitter = { + enable = true; + incrementalSelection = { + enable = true; + keymaps = { + initSelection = "g"; + nodeIncremental = "g"; + scopeIncremental = ""; + nodeDecremental = "gm"; + }; + }; + }; + }; } diff --git a/config/plugins/which-key.nix b/config/plugins/which-key.nix index 86bd772..80d0adb 100644 --- a/config/plugins/which-key.nix +++ b/config/plugins/which-key.nix @@ -1,7 +1,7 @@ { - plugins = { - which-key = { - enable = true; - }; - }; + plugins = { + which-key = { + enable = true; + }; + }; } diff --git a/config/sets.nix b/config/sets.nix index 8033c0a..c39bf94 100644 --- a/config/sets.nix +++ b/config/sets.nix @@ -1,73 +1,71 @@ -# The line beneath this is called `modeline`. See `:help modeline` -# vim: ts=4:sts=0:sw=0:noet { - config = { - globals = { - mapleader = " "; - maplocalleader = " "; - }; - options = { - relativenumber = true; - splitbelow = true; - redrawtime = 5000; - - # new split to the right - splitright = true; - - # show hidden characters - list = true; - - # don't break words on the edge - linebreak = true; - wrap = true; - # length of an actual \t character: - # https://stackoverflow.com/questions/191201/indenting-comments-to-match-code-in-vim - smartindent = false; - # length to use when shifting text (eg. <<, >> and == commands) - - tabstop=4; - shiftwidth = 0; - - expandtab = false; - autoindent = true; - # Set highlight on search - hlsearch = false; - - # Make line numbers default - number = true; - - # Enable mouse mode - mouse = "a"; - - # Sync clipboard between OS and Neovim. - # Remove this option if you want your OS clipboard to remain independent. - # See `:help 'clipboard'` - # vim.o.clipboard = 'unnamedplus' -- REMOVED BY ME - - # Enable break indent - breakindent = true; - - # Save undo history - # vim.o.undofile = true -- REMOVED BY ME - - # Case insensitive searching UNLESS /C or capital in search - ignorecase = true; - smartcase = true; - - # Keep signcolumn on by default - signcolumn = "yes"; - - # Decrease update time - updatetime = 250; - timeout = true; - # timeoutlen = 1000; # time of valid keypress like for leader key in millisecond - timeoutlen = 300; # lower to 300 in favor of which-key plugins - - # Set completeopt to have a better completion experience - completeopt = "menuone,noselect"; - - # NOTE: You should make sure your terminal supports this - termguicolors = true; - }; - }; + config = { + globals = { + mapleader = " "; + maplocalleader = " "; + }; + options = { + relativenumber = true; + splitbelow = true; + redrawtime = 5000; + + # new split to the right + splitright = true; + + # show hidden characters + list = true; + + # don't break words on the edge + linebreak = true; + wrap = true; + # length of an actual \t character: + # https://stackoverflow.com/questions/191201/indenting-comments-to-match-code-in-vim + smartindent = false; + # length to use when shifting text (eg. <<, >> and == commands) + + tabstop = 4; + shiftwidth = 0; + + expandtab = false; + autoindent = true; + # Set highlight on search + hlsearch = false; + + # Make line numbers default + number = true; + + # Enable mouse mode + mouse = "a"; + + # Sync clipboard between OS and Neovim. + # Remove this option if you want your OS clipboard to remain independent. + # See `:help 'clipboard'` + # vim.o.clipboard = 'unnamedplus' -- REMOVED BY ME + + # Enable break indent + breakindent = true; + + # Save undo history + # vim.o.undofile = true -- REMOVED BY ME + + # Case insensitive searching UNLESS /C or capital in search + ignorecase = true; + smartcase = true; + + # Keep signcolumn on by default + signcolumn = "yes"; + + # Decrease update time + updatetime = 250; + timeout = true; + # timeoutlen = 1000; # time of valid keypress like for leader key in millisecond + timeoutlen = 300; # lower to 300 in favor of which-key plugins + + # Set completeopt to have a better completion experience + completeopt = "menuone,noselect"; + + # NOTE: You should make sure your terminal supports this + termguicolors = true; + }; + }; }