From d154973cc8534781c5eb196a051e0a607a14a8ea Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Tue, 31 May 2022 11:55:59 -0400 Subject: [PATCH] update keybindings, add minimap plugin, disable mouse, add whitespace characters --- dot_config/lvim/config.lua | 56 +++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/dot_config/lvim/config.lua b/dot_config/lvim/config.lua index 50d3940..aa86088 100644 --- a/dot_config/lvim/config.lua +++ b/dot_config/lvim/config.lua @@ -1,21 +1,13 @@ +vim.opt.list = true +vim.opt.listchars = "tab:>-,trail:-" +vim.opt.mouse = "" + -- general lvim.log.level = "warn" lvim.format_on_save = true -- vim.o.background = "light" lvim.colorscheme = "base16-one-light" --- keymappings [view all the defaults by pressing Lk] -lvim.leader = "space" --- add your own keymapping --- lvim.keys.normal_mode[""] = ":w" --- unmap a default keymapping --- lvim.keys.normal_mode[""] = false --- edit a default keymapping --- lvim.keys.normal_mode[""] = ":q" -lvim.keys.normal_mode[""] = ":bprevious" -lvim.keys.normal_mode[""] = ":bnext" -lvim.keys.normal_mode[""] = ":pastetoggle" - vim.cmd [[ " Relative numbering function! NumberToggle() @@ -26,11 +18,17 @@ function! NumberToggle() set rnu endif endfunc - -" Toggle between normal and relative numbering. -noremap :call NumberToggle() ]] +-- keymappings [view all the defaults by pressing Lk] +lvim.leader = "space" +lvim.keys.normal_mode[""] = ":bprevious" +lvim.keys.normal_mode[""] = ":bnext" +lvim.keys.normal_mode[""] = ":pastetoggle" +lvim.keys.normal_mode[""] = ":call NumberToggle()" +lvim.keys.normal_mode[""] = ":lua vim.lsp.stop_client(vim.lsp.get_active_clients())" +lvim.keys.normal_mode["g"] = ":Telescope live_grep" + -- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. -- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. -- local _, actions = pcall(require, "telescope.actions") @@ -142,9 +140,20 @@ lvim.builtin.treesitter.highlight.enabled = true -- Additional Plugins lvim.plugins = { - {"RRethy/nvim-base16"}, - {"rebelot/kanagawa.nvim"}, - {"LunarVim/Colorschemes"}, + { "RRethy/nvim-base16" }, + { "rebelot/kanagawa.nvim" }, + { "LunarVim/Colorschemes" }, + { "nathom/filetype.nvim" }, + { + 'wfxr/minimap.vim', + run = "cargo install --locked code-minimap", + -- cmd = {"Minimap", "MinimapClose", "MinimapToggle", "MinimapRefresh", "MinimapUpdateHighlight"}, + config = function() + vim.cmd("let g:minimap_width = 10") + vim.cmd("let g:minimap_auto_start = 1") + vim.cmd("let g:minimap_auto_start_win_enter = 1") + end, + }, } -- {"folke/tokyonight.nvim"}, -- { @@ -159,5 +168,14 @@ lvim.plugins = { -- } lvim.autocommands.custom_groups = { { "FileType", "make", "set noexpandtab shiftwidth=8 softtabstop=0" }, - { "BufNewFile,BufRead", "justfile", "setf automake expandtab shiftwidth=8 softtabstop=0" }, + { "FileType", "justfile", "set expandtab tabstop=4 shiftwidth=4 softtabstop=4" } } + +local filetype = require("filetype") +filetype.setup({ + overrides = { + literal = { + ["justfile.nix"] = "just", + }, + }, +})