1

Compare commits

...

3 Commits

3 changed files with 55 additions and 4 deletions

View File

@ -119,6 +119,7 @@ in {
autoCmd = [ autoCmd = [
{ {
desc = "Lint the file if autolint is enabled";
event = ["BufWritePost"]; event = ["BufWritePost"];
callback.__raw = '' callback.__raw = ''
function() function()
@ -129,11 +130,12 @@ in {
''; '';
} }
{ {
desc = "Highlight yanked regions";
event = ["TextYankPost"]; event = ["TextYankPost"];
callback.__raw = "function() vim.highlight.on_yank() end"; callback.__raw = "function() vim.highlight.on_yank() end";
} }
{ {
# Resize splits when entire window is resized by wm desc = "Resize splits when Neovim is resized by the WM";
event = ["VimResized"]; event = ["VimResized"];
callback.__raw = '' callback.__raw = ''
function() function()
@ -144,11 +146,13 @@ in {
''; '';
} }
{ {
desc = "Disable conceal in JSON files";
event = ["FileType"]; event = ["FileType"];
pattern = ["json" "jsonc" "json5"]; # Disable conceal for these filetypes pattern = ["json" "jsonc" "json5"]; # Disable conceal for these filetypes
callback.__raw = "function() vim.opt_local.conceallevel = 0 end"; callback.__raw = "function() vim.opt_local.conceallevel = 0 end";
} }
{ {
desc = "Attach JDTLS to Java files";
event = ["FileType"]; event = ["FileType"];
pattern = ["Java" "java"]; pattern = ["Java" "java"];
callback.__raw = '' callback.__raw = ''
@ -168,6 +172,20 @@ in {
end end
''; '';
} }
{
desc = "Enable line wrapping in telescope preview";
event = ["User"];
pattern = ["TelescopePreviewerLoaded"];
callback.__raw = ''
function(args)
if args.data.bufname:match("*.csv") then
vim.wo.wrap = false
else
vim.wo.wrap = true
end
end
'';
}
]; ];
keymaps = import ./mappings.nix {inherit lib mylib;}; keymaps = import ./mappings.nix {inherit lib mylib;};
@ -1414,6 +1432,10 @@ in {
''; '';
opts = { opts = {
defaults = { defaults = {
wrap_results = false; # Do wrapping in the preview instead, see autoCmd
preview = {
treesitter = true;
};
mappings = { mappings = {
i = { i = {
"<Esc>" = {__raw = ''function(...) return require("telescope.actions").close(...) end'';}; "<Esc>" = {__raw = ''function(...) return require("telescope.actions").close(...) end'';};
@ -1761,7 +1783,9 @@ in {
luasnip # Snippets # TODO: How to add snippets, maybe use luasnip from nixvim directly? luasnip # Snippets # TODO: How to add snippets, maybe use luasnip from nixvim directly?
ltex-extra # Additional ltex lsp support, e.g. for add-to-dictionary action ltex-extra # Additional ltex lsp support, e.g. for add-to-dictionary action
markview # Markdown support
markview # Markdown support # TODO: Disable in help buffers + confiure a bit more
# narrow-region # Open a buffer restricted to the selection # narrow-region # Open a buffer restricted to the selection
navbuddy # Structural file view navbuddy # Structural file view
neo-tree # File tree sidebar neo-tree # File tree sidebar

View File

@ -257,15 +257,33 @@
action = "<cmd>Telescope current_buffer_fuzzy_find<cr>"; action = "<cmd>Telescope current_buffer_fuzzy_find<cr>";
options.desc = "Grep Buffer"; options.desc = "Grep Buffer";
} }
{
mode = "n";
key = ";";
action = "%";
options.desc = "Matching ()[]<>";
}
{ {
mode = "v"; mode = "v";
key = ";"; key = ";";
action = "<Esc>"; action = "<Esc>";
options.desc = "Exit Visual Mode"; options.desc = "Exit Visual Mode";
} }
{
mode = "v";
key = "?";
action = "<cmd>Telescope grep_string<cr>";
options.desc = "Find Selection";
}
]; ];
leader = [ leader = [
{
mode = "n";
key = "<leader>l";
action = "<cmd>Telescope oldfiles<cr>";
options.desc = "Last Files";
}
{ {
mode = "n"; mode = "n";
key = "<leader>L"; key = "<leader>L";
@ -296,6 +314,12 @@
action = "<cmd>Telescope resume<cr>"; action = "<cmd>Telescope resume<cr>";
options.desc = "Last Telescope Picker"; options.desc = "Last Telescope Picker";
} }
{
mode = "n";
key = "<leader>;";
action = "<cmd>Telescope command_history<cr>";
options.desc = "Last Commands";
}
{ {
mode = "n"; mode = "n";
key = "<leader>:"; key = "<leader>:";
@ -425,15 +449,16 @@
action = "+buffers"; action = "+buffers";
} }
{ {
# See :h telescope.builtin.buffers() for sorting opts
mode = "n"; mode = "n";
key = "<leader>bb"; key = "<leader>bb";
action = "<cmd>Telescope buffers sort_lastused=true<cr>"; # There is also sort_mru=true action = "<cmd>Telescope buffers ignore_current_buffer=false sort_mru=true<cr>";
options.desc = "List Buffers"; options.desc = "List Buffers";
} }
{ {
mode = "n"; mode = "n";
key = "<leader><Space>"; key = "<leader><Space>";
action = "<cmd>Telescope buffers sort_lastused=true<cr>"; action = "<cmd>Telescope buffers ignore_current_buffer=false sort_mru=true<cr>";
options.desc = "List Buffers"; options.desc = "List Buffers";
} }
{ {
@ -702,6 +727,7 @@
# options.desc = "Rename LSP symbol"; # options.desc = "Rename LSP symbol";
# } # }
{ {
# NOTE: There is also Telescope quickfix
mode = "n"; mode = "n";
key = "<leader>ca"; key = "<leader>ca";
action = "<cmd>lua vim.lsp.buf.code_action()<cr>"; action = "<cmd>lua vim.lsp.buf.code_action()<cr>";

View File

@ -16,6 +16,7 @@
winblend = 30; # Floating popup transparency winblend = 30; # Floating popup transparency
sessionoptions = ["buffers" "curdir" "tabpages" "winsize" "help" "globals" "skiprtp" "folds"]; sessionoptions = ["buffers" "curdir" "tabpages" "winsize" "help" "globals" "skiprtp" "folds"];
showtabline = 0; # Disable tabline showtabline = 0; # Disable tabline
conceallevel = 2;
# Cursor # Cursor
ruler = true; # Show cursor position in status line ruler = true; # Show cursor position in status line