diff --git a/README.md b/README.md index 2a9e348..7cc5025 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ once the dotfiles are installed, see `~/.config/dot_profile.example` for more in rather than through conventional means. This has less complexity than a plugin manager since I already manage all my dotfiles under Git. Plugins are declared in `.gitmodules`. +- Submodules may take a lot of space (as of writing 0.5GB), so you may want to `git submodule deinit -f` some of them, manually pick the plugins you want, or even forgo all submodules. + **Desktop Preview** ![preview](https://raw.githubusercontent.com/DogeyStamp/dots/main/preview.png) diff --git a/src/.config/nvim/coding.vim b/src/.config/nvim/coding.vim index 99346bb..235c69c 100644 --- a/src/.config/nvim/coding.vim +++ b/src/.config/nvim/coding.vim @@ -10,11 +10,3 @@ source $XDG_CONFIG_HOME/nvim/vimspector.vim " auto-pairs let g:AutoPairsFlyMode = 0 - -" trouble.nvim -nnoremap dxx TroubleToggle -nnoremap dxw TroubleToggle workspace_diagnostics -nnoremap dxd TroubleToggle document_diagnostics -nnoremap dxq TroubleToggle quickfix -nnoremap dxl TroubleToggle loclist -nnoremap gR TroubleToggle lsp_references diff --git a/src/.config/nvim/init.vim b/src/.config/nvim/init.vim index 094ef2b..9745508 100755 --- a/src/.config/nvim/init.vim +++ b/src/.config/nvim/init.vim @@ -67,8 +67,8 @@ nnoremap :vertical resize +5 " exit all (akin to ZZ, ZQ) nnoremap ZF :qa -" copy URL under cursor to clipboard bind -:nnoremap uu :let @+ = expand('') +" see .config/nvim/lua/init.lua +lua require('init') " The rest will not be sourced if the system is on minimal settings. if $SYSTEM_PROFILE == "MINIMAL" @@ -96,11 +96,4 @@ highlight GitGutterDelete ctermfg=red " fancy picker stuff -source $XDG_CONFIG_HOME/nvim/telescope.vim - source $XDG_CONFIG_HOME/nvim/color.vim - -if $SYSTEM_PROFILE == "DEFAULT" - " see .config/nvim/lua/init.lua - lua require('init') -endif diff --git a/src/.config/nvim/lua/coding.lua b/src/.config/nvim/lua/coding.lua index dc55e45..45f05e3 100644 --- a/src/.config/nvim/lua/coding.lua +++ b/src/.config/nvim/lua/coding.lua @@ -1,5 +1,8 @@ -- stuff for coding +confutil = require("confutil") +keymap = confutil.keymap + ------ @@ -42,6 +45,12 @@ require('trouble').setup({ }, use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client }) +keymap("dxx", "TroubleToggle") +keymap("dxw", "TroubleToggle workspace_diagnostics") +keymap("dxd", "TroubleToggle document_diagnostics") +keymap("dxq", "TroubleToggle quickfix") +keymap("dxl", "TroubleToggle loclist") +keymap("gR", "TroubleToggle lsp_references") diff --git a/src/.config/nvim/lua/confutil.lua b/src/.config/nvim/lua/confutil.lua new file mode 100644 index 0000000..552c587 --- /dev/null +++ b/src/.config/nvim/lua/confutil.lua @@ -0,0 +1,34 @@ +-- configuration utility functions and variables + +local M = {} + +-- nnoremap, etc. +function M.keymap(key, cmd, params) + if params == nil then + params = {} + end + + default_params = { + silent=true, + mode="n", + noremap=true, + } + setmetatable(params, { + __index = function (table, key) + return default_params[key] + end + }) + + vim.api.nvim_set_keymap(params.mode, key, cmd, { silent=params.silent, noremap=params.noremap }) +end + +-- see ~/.config/dot_profile.example for info +-- enables/disables features based on system profile +M.profile_table = { + DEFAULT=80, + SLIM=40, + MINIMAL=10, +} +M.dotprofile = M.profile_table[os.getenv("SYSTEM_PROFILE")] or profile_table.SLIM + +return M diff --git a/src/.config/nvim/lua/init.lua b/src/.config/nvim/lua/init.lua index a268d08..d252fa9 100644 --- a/src/.config/nvim/lua/init.lua +++ b/src/.config/nvim/lua/init.lua @@ -1,3 +1,10 @@ +-- lua entry point + +confutil = require("confutil") + +keymap = confutil.keymap +dotprofile, profile_table = confutil.dotprofile, confutil.profile_table + -------------------------------- -------------------------------- -- miscellaneous plugins @@ -14,11 +21,12 @@ require("urlview").setup({ next = "uh", }, }) - +-- bind to copy URL under cursor +keymap("uu", ":let @+ = expand('')") ------ -- fancy prompts --- plug: dressing.nvim +-- plug: dressing.nvim, telescope.nvim, plenary.nvim ------ require('dressing').setup({ input = { @@ -26,6 +34,13 @@ require('dressing').setup({ } }) +keymap("ef", "Telescope find_files") +keymap("eg", "Telescope live_grep") +keymap("em", "Telescope buffers") +keymap("eh", "Telescope help_tags") +keymap("es", "Telescope lsp_document_symbols") +keymap("eb", "Telescope keymaps") + -------------------------------- @@ -34,4 +49,6 @@ require('dressing').setup({ -------------------------------- -------------------------------- -require("coding") +if dotprofile >= profile_table.DEFAULT then + require("coding") +end diff --git a/src/.config/nvim/telescope.vim b/src/.config/nvim/telescope.vim deleted file mode 100644 index 16f24c9..0000000 --- a/src/.config/nvim/telescope.vim +++ /dev/null @@ -1,8 +0,0 @@ -" depends on: telescope.nvim, plenary.nvim - -nnoremap ef Telescope find_files -nnoremap eg Telescope live_grep -nnoremap em Telescope buffers -nnoremap eh Telescope help_tags -nnoremap es Telescope lsp_document_symbols -nnoremap eb Telescope keymaps