Added indent lines and moved over to better whichkey implementation

This commit is contained in:
Warwick 2023-08-16 16:52:25 +01:00
parent 79e895551d
commit be41c8120c
5 changed files with 41 additions and 29 deletions

View file

@ -14,3 +14,6 @@ vim.opt.tabstop = 2 -- Seems to be default for most lsp's now
vim.opt.shiftwidth = 2
vim.opt.shiftround = true
vim.opt.expandtab = true
-- line numbers are handy
vim.opt.number = true

View file

@ -0,0 +1,6 @@
require("indent_blankline").setup {
-- for example, context is off by default, use this to turn it on
show_current_context = false,
show_current_context_start = false,
}
vim.cmd [[colorscheme gruvbox]]

View file

@ -1,4 +1,3 @@
require("core.plugin_config.gruvbox")
require("core.plugin_config.lualine")
require("core.plugin_config.nvim-tree")
require("core.plugin_config.telescope")
@ -7,3 +6,5 @@ require("core.plugin_config.lsp_config")
require("core.plugin_config.completions")
require("core.plugin_config.terminal")
require("core.plugin_config.whichkey")
require("core.plugin_config.indent-blankline")
require("core.plugin_config.gruvbox")

View file

@ -1,27 +1,23 @@
local whichkey = require("whichkey_setup")
-- lsp format
vim.g.formatfix = function()
vim.lsp.buf.format { async = true }
end
local whichkey = require("which-key")
-- TODO fix <cmd> based instructions
local keymap = {
t = 'Toggle Terminal',
l = {
name = '+lsp',
e = { "vim.diagnostic.open_float", 'Diagnostic Float' },
n = { "vim.diagnostic.goto_next", 'Next Diagnostic' },
N = { "vim.diagnostic.goto_prev", 'Previous Diagnostic' },
j = { "vim.diagnostic.setloclist", 'Diagnostic List' },
e = { "<cmd>lua vim.diagnostic.open_float()<cr>", 'Diagnostic Float' },
n = { "<cmd>lua vim.diagnostic.goto_next()<cr>", 'Next Diagnostic' },
N = { "<cmd>lua vim.diagnostic.goto_prev()<cr>", 'Previous Diagnostic' },
j = { "<cmd>lua vim.diagnostic.setloclist()<cr>", 'Diagnostic List' },
--- Dynamic to each buffer potential TODO?
D = { "vim.lsp.buf.declaration", 'Declaration' },
d = { "vim.lsp.buf.definition", 'Definition' },
k = { "vim.lsp.buf.hover", 'Hover' },
i = { "vim.lsp.buf.implementation", 'Implementation' },
t = { "vim.lsp.buf.type_definition", 'Type Definition' },
R = { "vim.lsp.buf.rename", 'Rename' },
a = { "vim.lsp.buf.code_action", 'Code Action' },
r = { "vim.lsp.buf.references", 'References' },
f = { "<cmd>lua vim.g.formatfix()<CR>", 'Format' },
D = { "<cmd>lua vim.lsp.buf.declaration()<cr>", 'Declaration' },
d = { "<cmd>lua vim.lsp.buf.definition()<cr>", 'Definition' },
k = { "<cmd>lua vim.lsp.buf.hover()<cr>", 'Hover' },
i = { "<cmd>lua vim.lsp.buf.implementation()<cr>", 'Implementation' },
t = { "<cmd>lua vim.lsp.buf.type_definition()<cr>", 'Type Definition' },
R = { "<cmd>lua vim.lsp.buf.rename()<cr>", 'Rename' },
a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", 'Code Action' },
r = { "<cmd>lua vim.lsp.buf.references()<cr>", 'References' },
f = { function() vim.lsp.buf.format { async = true } end, 'Format' },
},
f = {
@ -39,7 +35,7 @@ local keymap = {
}
}
whichkey.config {
whichkey.setup {
hide_statusline = false,
default_keymap_settings = {
silent = true,
@ -48,4 +44,4 @@ whichkey.config {
default_mode = 'n',
}
whichkey.register_keymap('leader', keymap)
whichkey.register(keymap, { prefix = '<leader>' })

View file

@ -18,15 +18,21 @@ local plugins = {
'nvim-tree/nvim-web-devicons',
'nvim-lualine/lualine.nvim',
'nvim-treesitter/nvim-treesitter',
{'windwp/nvim-autopairs',
{
'windwp/nvim-autopairs',
event = "InsertEnter",
opts = {} -- this is equalent to setup({}) function
},
'akinsho/toggleterm.nvim',
{
'AckslD/nvim-whichkey-setup.lua',
dependencies = {'liuchengxu/vim-which-key'},
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
},
"lukas-reineke/indent-blankline.nvim",
-- fzf
{
'nvim-telescope/telescope.nvim',