Moving to neovim 0.11, new calc, keys streamlined
Keybindings: - <space>E (explain error) now is <space>x - dropped <C-W>0 and following, were remainders from Emacs - insert: <C-Del> now deletes word right of cursor LSP: - diagnostics popup replaced with neovim 0.11 virtual lines (much nicer) Options: - neo-tree width dropped, was too wide - workspaces no longer auto open, was interfering with using neovim as git client or file manager Plugins: - replaced cmp-rpncalc with qalc.nvim (which uses the qalc cli)
This commit is contained in:
@@ -2,7 +2,7 @@ local bufnr = vim.api.nvim_get_current_buf()
|
|||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"<space>E",
|
"<space>x",
|
||||||
function()
|
function()
|
||||||
vim.cmd.RustLsp({ 'explainError', 'current' })
|
vim.cmd.RustLsp({ 'explainError', 'current' })
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -89,11 +89,8 @@ cmp.setup({
|
|||||||
{ name = 'luasnip' }, -- For luasnip user
|
{ name = 'luasnip' }, -- For luasnip user
|
||||||
{ name = 'buffer' }, -- For buffer word completion
|
{ name = 'buffer' }, -- For buffer word completion
|
||||||
{ name = 'path' }, -- For path completion
|
{ name = 'path' }, -- For path completion
|
||||||
{ name = 'rpncalc' }, -- for RPN calculations
|
|
||||||
{ name = 'orgmode' }, -- for nvim-orgmode
|
{ name = 'orgmode' }, -- for nvim-orgmode
|
||||||
{ name = 'sonicpi' }, -- for sonic-pi integration
|
{ name = 'sonicpi' }, -- for sonic-pi integration
|
||||||
|
{ name = 'calc' }, -- for calulcator
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -77,12 +77,9 @@ vim.keymap.set('n', '<space>mc', mywords.uhl_all, { desc = "Clear all highlights
|
|||||||
-- Shortcuts which are known from Emacs
|
-- Shortcuts which are known from Emacs
|
||||||
--
|
--
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
vim.keymap.set('n', '<C-W>0', ":hide<CR>", { desc = "Win: close current" })
|
|
||||||
vim.keymap.set('n', '<C-W>1', ":only<CR>", { desc = "Win: close others" })
|
|
||||||
vim.keymap.set('n', '<C-W>2', ":split<CR>", { desc = "Win: split horizontally" })
|
|
||||||
vim.keymap.set('n', '<C-W>2', ":vsplit<CR>", { desc = "Win: split vertically" })
|
|
||||||
vim.keymap.set('n', '<space>q', "gwap", { desc = "Wrap paragraph" })
|
vim.keymap.set('n', '<space>q', "gwap", { desc = "Wrap paragraph" })
|
||||||
vim.keymap.set('n', '<esc><esc>', ":silent! nohls<CR>", { desc = "Clear search" })
|
vim.keymap.set('n', '<esc><esc>', ":silent! nohls<CR>", { desc = "Clear search" })
|
||||||
|
vim.keymap.set('i', '<c-Del>', '<c-o>dW', {desc = "Delete word right" })
|
||||||
|
|
||||||
-- horizontally scroll with mouse
|
-- horizontally scroll with mouse
|
||||||
vim.keymap.set('n', '<S-ScrollWheelUp>', 'zh')
|
vim.keymap.set('n', '<S-ScrollWheelUp>', 'zh')
|
||||||
|
|||||||
@@ -57,7 +57,11 @@ local on_attach = function(client, bufnr)
|
|||||||
local fzf = require('fzf-lua')
|
local fzf = require('fzf-lua')
|
||||||
vim.keymap.set('n', '<space>d', fzf.diagnostics_document, { desc = "Document diagnostics" })
|
vim.keymap.set('n', '<space>d', fzf.diagnostics_document, { desc = "Document diagnostics" })
|
||||||
vim.keymap.set('n', '<space>D', fzf.diagnostics_workspace, { desc = "Workspace diagnostics" })
|
vim.keymap.set('n', '<space>D', fzf.diagnostics_workspace, { desc = "Workspace diagnostics" })
|
||||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, { desc = "Popup diagnostics" })
|
-- vim.keymap.set('n', '<space>E', vim.diagnostic.open_float, { desc = "Popup diagnostics" })
|
||||||
|
vim.keymap.set('n', '<space>e', function()
|
||||||
|
local new_config = not vim.diagnostic.config().virtual_lines
|
||||||
|
vim.diagnostic.config({ virtual_lines = new_config })
|
||||||
|
end, { desc = "Virtual line diagnostics" })
|
||||||
vim.keymap.set('n', '<space>s', fzf.lsp_document_symbols, { desc = "Doc symbols" })
|
vim.keymap.set('n', '<space>s', fzf.lsp_document_symbols, { desc = "Doc symbols" })
|
||||||
vim.keymap.set('n', '<space>c', fzf.lsp_code_actions, { desc = "Code Actions" })
|
vim.keymap.set('n', '<space>c', fzf.lsp_code_actions, { desc = "Code Actions" })
|
||||||
vim.keymap.set('n', '<space>[', vim.diagnostic.goto_prev, { desc = "Previous diagnostics" })
|
vim.keymap.set('n', '<space>[', vim.diagnostic.goto_prev, { desc = "Previous diagnostics" })
|
||||||
|
|||||||
@@ -290,7 +290,6 @@ require("lazy").setup({
|
|||||||
require("neo-tree").setup({
|
require("neo-tree").setup({
|
||||||
window = {
|
window = {
|
||||||
position = "left",
|
position = "left",
|
||||||
width = 60,
|
|
||||||
mappings = {
|
mappings = {
|
||||||
["<tab>"] = {
|
["<tab>"] = {
|
||||||
"toggle_node",
|
"toggle_node",
|
||||||
@@ -324,7 +323,7 @@ require("lazy").setup({
|
|||||||
mru_sort = false,
|
mru_sort = false,
|
||||||
|
|
||||||
-- option to automatically activate workspace when opening neovim in a workspace directory
|
-- option to automatically activate workspace when opening neovim in a workspace directory
|
||||||
auto_open = true,
|
auto_open = false,
|
||||||
|
|
||||||
-- option to automatically activate workspace when changing directory not via this plugin
|
-- option to automatically activate workspace when changing directory not via this plugin
|
||||||
auto_dir = true,
|
auto_dir = true,
|
||||||
@@ -336,12 +335,22 @@ require("lazy").setup({
|
|||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
-- rpn calculator
|
-- calulcation in cmp
|
||||||
-- also added as source to cmp
|
|
||||||
{
|
{
|
||||||
"PhilRunninger/cmp-rpncalc",
|
"hrsh7th/cmp-calc",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- calculate using qalc cli, call :QalcAttach or :Qalc
|
||||||
|
{
|
||||||
|
"Apeiros-46B/qalc.nvim",
|
||||||
|
config = function()
|
||||||
|
require('qalc').setup({
|
||||||
|
bufname = "Qalculate",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
-- TODO, WARN, HACK, PERF, NOTE, TEST and others highlighting and searching
|
-- TODO, WARN, HACK, PERF, NOTE, TEST and others highlighting and searching
|
||||||
{
|
{
|
||||||
"folke/todo-comments.nvim",
|
"folke/todo-comments.nvim",
|
||||||
|
|||||||
Reference in New Issue
Block a user