Misc: rust, shortcuts, show indent, org-mode to HTML improvement
Keybindings: - Rust F5 - show run targets - Rust Shift-F5 - run last target - Normal: Space-o - open current file in chromium - Visual: Space-f - LSP format current region Configuration: - org-mode: use pandoc to generate a standalone HTML, support plantuml blocks - no winbar for neo tree - disabled treesitter asciidoc, seems to be broken - splash screen: added browse, reordered entries Plugins: - use indent-blankline to visualize indents
This commit is contained in:
@@ -6,5 +6,26 @@ vim.keymap.set(
|
||||
function()
|
||||
vim.cmd.RustLsp({ 'explainError', 'current' })
|
||||
end,
|
||||
{ silent = true, buffer = bufnr, desc = 'Rust: explain error at cursor' }
|
||||
{ silent = true, buffer = bufnr, desc = 'RustLSP: explain error at cursor' }
|
||||
)
|
||||
|
||||
|
||||
-- show run targets
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<f5>",
|
||||
function()
|
||||
vim.cmd.RustLsp({ 'runnables' })
|
||||
end,
|
||||
{ silent = true, buffer = bufnr, desc = 'RustLSP: show runnables' }
|
||||
)
|
||||
|
||||
-- run last target
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<S-f5>",
|
||||
function()
|
||||
vim.cmd.RustLsp({ 'runnables', bang = true })
|
||||
end,
|
||||
{ silent = true, buffer = bufnr, desc = 'RustLSP: show runnables' }
|
||||
)
|
||||
|
||||
@@ -23,6 +23,9 @@ vim.keymap.set('n', '<leader>T', ":Neotree reveal<CR>", { desc = "File Manager"
|
||||
-- calendar
|
||||
vim.keymap.set('n', '<leader>c', ":Calendar -split=horizontal -position=below -height=12<CR>", { desc = "Show calendar" })
|
||||
|
||||
-- Open current file in browser (chromium)
|
||||
vim.keymap.set('n', '<space>o', ":silent !chromium '%'<cr>", { desc = "Open in browser" })
|
||||
|
||||
--
|
||||
-- configure workspaces
|
||||
-- also add a custom picker to fzf
|
||||
|
||||
13
lua/lsp.lua
13
lua/lsp.lua
@@ -11,17 +11,25 @@ require('mason').setup({
|
||||
require('mason-lspconfig').setup({
|
||||
-- A list of servers to automatically install if they're not already installed
|
||||
ensure_installed = {
|
||||
'pylsp',
|
||||
'lua_ls',
|
||||
-- 'rust_analyzer', -- handled by rust mrcjkb/rustaceanvim
|
||||
'yamlls',
|
||||
'ts_ls',
|
||||
'gopls',
|
||||
'pylsp',
|
||||
'clangd',
|
||||
},
|
||||
})
|
||||
|
||||
-- lsp format selected range
|
||||
function LSPRangeFormatFunction()
|
||||
vim.lsp.buf.format({
|
||||
async = true,
|
||||
range = {
|
||||
["start"] = vim.api.nvim_buf_get_mark(0, "<"),
|
||||
["end"] = vim.api.nvim_buf_get_mark(0, ">"),
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
@@ -43,6 +51,7 @@ local on_attach = function(client, bufnr)
|
||||
vim.keymap.set("n", "<space>f", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, { desc = "LSP Format buffer", unpack(bufopts) })
|
||||
vim.keymap.set("v", "<space>f", LSPRangeFormatFunction, { desc = "LSP Format region" })
|
||||
|
||||
-- 2024-09-09 - some ccflow commands for diagnostics, symbols and code actions
|
||||
local fzf = require('fzf-lua')
|
||||
|
||||
@@ -94,7 +94,7 @@ require("lazy").setup({
|
||||
action = function(exporter)
|
||||
local current_file = vim.api.nvim_buf_get_name(0)
|
||||
local target = vim.fn.fnamemodify(current_file, ':p:r') .. '.html'
|
||||
local command = { 'pandoc', current_file, '-o', target }
|
||||
local command = { 'pandoc', '--filter', 'pandoc-plot', current_file, '--standalone', '--output', target }
|
||||
local on_success = function(output)
|
||||
print('Success!')
|
||||
vim.api.nvim_echo({ { table.concat(output, '\n') } }, true, {})
|
||||
@@ -224,7 +224,7 @@ require("lazy").setup({
|
||||
section_separators = {},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
winbar = { "neo-tree" },
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
@@ -263,7 +263,8 @@ require("lazy").setup({
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_a = {
|
||||
{ breadcrumb,
|
||||
{
|
||||
breadcrumb,
|
||||
color = { bg = '#101010', fg = '#999999' },
|
||||
draw_empty = true
|
||||
}
|
||||
@@ -339,7 +340,8 @@ require("lazy").setup({
|
||||
},
|
||||
|
||||
-- treesitter asciidoc support
|
||||
{ "cpkio/nvim-treesitter-asciidoc" },
|
||||
-- // NOTE.2025-01-17 seems to be broken
|
||||
-- { "cpkio/nvim-treesitter-asciidoc" },
|
||||
|
||||
|
||||
-- Greeter to run on NeoVim startup
|
||||
@@ -424,9 +426,10 @@ require("lazy").setup({
|
||||
dashboard.section.header.val = vim.split(adjustedLogo, '\n')
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button('h', ' Browse ~', '<cmd>Neotree<CR>'),
|
||||
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
|
||||
dashboard.button('u', ' Update plugins', '<cmd>Lazy update<CR>'),
|
||||
dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'),
|
||||
dashboard.button('u', ' Update plugins', '<cmd>Lazy update<CR>'),
|
||||
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
|
||||
dashboard.button('q', ' Quit', '<cmd>qa<CR>'),
|
||||
}
|
||||
@@ -527,4 +530,13 @@ require("lazy").setup({
|
||||
{
|
||||
'mfussenegger/nvim-dap'
|
||||
},
|
||||
|
||||
-- show indent markers
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
---@module "ibl"
|
||||
---@type ibl.config
|
||||
opts = {},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user