diff --git a/init.lua b/init.lua index 53e57e39..c73fa1a8 100644 --- a/init.lua +++ b/init.lua @@ -186,10 +186,10 @@ vim.keymap.set('n', 'bn', 'bnext', { desc = 'Next buffer' }) vim.keymap.set('n', 'bp', 'bprevious', { desc = 'Previous buffer' }) -- Move lines up/down -vim.keymap.set('n', '', 'm .+1==', { desc = 'Move line down' }) -vim.keymap.set('n', '', 'm .-2==', { desc = 'Move line up' }) -vim.keymap.set('v', '', "m '>+1gv=gv", { desc = 'Move selection down' }) -vim.keymap.set('v', '', "m '<-2gv=gv", { desc = 'Move selection up' }) +-- vim.keymap.set('n', '', 'm .+1==', { desc = 'Move line down' }) +-- vim.keymap.set('n', '', 'm .-2==', { desc = 'Move line up' }) +-- vim.keymap.set('v', '', "m '>+1gv=gv", { desc = 'Move selection down' }) +-- vim.keymap.set('v', '', "m '<-2gv=gv", { desc = 'Move selection up' }) -- Better indenting in visual mode vim.keymap.set('v', '<', ''] = { 'actions.select' }, - [''] = { 'actions.select' }, - [''] = { 'actions.parent' }, - [''] = { 'actions.close', mode = 'n' }, - [''] = { 'actions.close', mode = 'n' }, - [''] = { 'actions.select', opts = { vertical = true } }, - [''] = { 'actions.select', opts = { horizontal = true } }, - [''] = { 'actions.select', opts = { tab = true } }, - [''] = false, - }, - view_options = { - show_hidden = true, - natural_order = 'fast', - is_always_hidden = function(name, _) - return name == '..' or name == '.git' - end, - }, - win_options = { - signcolumn = 'yes:2', - wrap = true, - }, - preview_win = { - disable_preview = function(filename) - return filename:match '^%.' - end, - }, - sort = { - { 'name', 'asc' }, - }, - buf_options = { - buflisted = false, - bufhidden = 'delete', -- Delete the buffer immediately when hidden - }, - cleanup_delay_ms = 0, -- Or set to false to disable auto-cleanup entirely if you prefer - } - - vim.keymap.set('n', '-', oil.toggle_float, { desc = 'Open parent directory' }) - - -- Always show preview - vim.api.nvim_create_autocmd('User', { - pattern = 'OilEnter', - callback = vim.schedule_wrap(function(args) - if vim.api.nvim_get_current_buf() == args.data.buf and oil.get_cursor_entry() then - oil.open_preview() - end - end), - }) - end, -} diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua deleted file mode 100644 index 2106204c..00000000 --- a/lua/kickstart/plugins/autopairs.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - opts = {}, -} diff --git a/lua/kickstart/plugins/lsp/main-lsp.lua b/lua/kickstart/plugins/lsp/main-lsp.lua index cd1b9796..5a3f876b 100644 --- a/lua/kickstart/plugins/lsp/main-lsp.lua +++ b/lua/kickstart/plugins/lsp/main-lsp.lua @@ -152,6 +152,9 @@ return { vue_ls = {}, eslint = {}, yamlls = {}, + qmlls = { + capabilities = capabilities, + }, html = { filetypes = { 'html', 'htmldjango', 'htmldjango-template', 'htmljinja', 'htmlmin' }, }, diff --git a/lua/kickstart/plugins/mini.lua b/lua/kickstart/plugins/mini.lua index 69a98f44..e59ce293 100644 --- a/lua/kickstart/plugins/mini.lua +++ b/lua/kickstart/plugins/mini.lua @@ -5,6 +5,62 @@ return { require('mini.ai').setup { n_lines = 500 } require('mini.surround').setup() require('mini.move').setup() + require('mini.pairs').setup() + require('mini.bracketed').setup() + require('mini.notify').setup { + window = { + winblend = 0, + }, + } + local MiniFiles = require 'mini.files' + MiniFiles.setup { + mappings = { + go_out = '', + go_in = '', + go_in_plus = '', + synchronize = '', + }, + windows = { + preview = true, + width_preview = 100, + }, + } + + local minifiles_toggle = function(dir) + if not MiniFiles.close() then + MiniFiles.open(dir) + end + end + + local open_file_in_minifiles = function() + minifiles_toggle(vim.fn.expand '%:p') + end + + local set_cwd = function() + local path = (MiniFiles.get_fs_entry() or {}).path + if path == nil then + return vim.notify 'Cursor is not on valid entry' + end + vim.fn.chdir(vim.fs.dirname(path)) + end + + -- Yank in register full path of entry under cursor + local yank_path = function() + if MiniFiles.get_explorer_state().target_window ~= nil then + local path = (MiniFiles.get_fs_entry() or {}).path + if path == nil then + return vim.notify 'Cursor is not on valid entry' + end + vim.fn.setreg(vim.v.register, path) + end + end + + vim.keymap.set('n', 're', minifiles_toggle, { desc = 'Open Explorer in root' }) + vim.keymap.set('n', 'e', open_file_in_minifiles, { desc = 'Open Explorer in current file' }) + vim.keymap.set('n', 'cwd', set_cwd, { desc = 'Set cwd' }) + vim.keymap.set('n', 'yp', yank_path, { desc = 'Yank path' }) + vim.keymap.set('n', '', MiniFiles.go_in, { desc = 'Open file' }) + local statusline = require 'mini.statusline' -- set use_icons to true if you have a Nerd Font statusline.setup { use_icons = vim.g.have_nerd_font } diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua index 732c1bc9..9a7cfabc 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/kickstart/plugins/treesitter.lua @@ -33,7 +33,7 @@ return { -- Highlight, edit, and navigate code 'jsonc', 'markdown', 'markdown_inline', - 'python', + -- 'python', 'rust', 'toml', 'yaml', @@ -42,14 +42,25 @@ return { -- Highlight, edit, and navigate code auto_install = true, highlight = { enable = true, - disable = { 'python' }, -- list of language that will be disabled + disable = {}, -- list of language that will be disabled -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. -- If you are experiencing weird indenting issues, add the language to -- the list of additional_vim_regex_highlighting and disabled languages for indent. additional_vim_regex_highlighting = { 'ruby' }, }, indent = { enable = true, disable = { 'ruby' } }, - textobjects = { select = { enable = true, lookahead = true } }, + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', + }, + }, + }, }, -- There are additional nvim-treesitter modules that you can use textobjectsto in -- eract