neovim conf part 8, now with snacks and mini
This commit is contained in:
parent
36c7c39213
commit
bbd1f9f7c1
13 changed files with 208 additions and 127 deletions
|
@ -18,8 +18,8 @@ return {
|
|||
|
||||
vim.keymap.set('n', '<C-l>', function() harpoon:list():select(1) end)
|
||||
vim.keymap.set('n', '<C-j>', function() harpoon:list():select(2) end)
|
||||
vim.keymap.set('n', '<C-f>', function() harpoon:list():select(3) end)
|
||||
vim.keymap.set('n', '<C-g>', function() harpoon:list():select(4) end)
|
||||
vim.keymap.set('n', '<Down>', function() harpoon:list():select(3) end)
|
||||
vim.keymap.set('n', '<Up>', function() harpoon:list():select(4) end)
|
||||
|
||||
-- -- Toggle previous & next buffers stored within Harpoon list
|
||||
-- vim.keymap.set('n', '<C-S-P>', function() harpoon:list():prev() end)
|
||||
|
|
|
@ -15,28 +15,29 @@ vim.opt.rtp:prepend(lazypath)
|
|||
require('lazy').setup({
|
||||
-- NOTE: General Editing --
|
||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||
{
|
||||
'm4xshen/autoclose.nvim',
|
||||
opts = {
|
||||
keys = {
|
||||
['%'] = { close = true, escape = true, pair = '%%', enabled_filetypes = { 'htmldjango' } },
|
||||
},
|
||||
options = { disable_when_touch = true, }
|
||||
}
|
||||
},
|
||||
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = {} },
|
||||
|
||||
{
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
main = 'ibl',
|
||||
---@module 'ibl'
|
||||
---@type ibl.config
|
||||
opts = {},
|
||||
},
|
||||
-- TODO: i dunno about this one
|
||||
-- {
|
||||
-- "folke/noice.nvim",
|
||||
-- event = "VeryLazy",
|
||||
-- opts = {
|
||||
-- },
|
||||
-- dependencies = {
|
||||
-- -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
-- "MunifTanjim/nui.nvim",
|
||||
-- -- OPTIONAL:
|
||||
-- -- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- -- If not available, we use `mini` as the fallback
|
||||
-- "rcarriga/nvim-notify",
|
||||
-- }
|
||||
-- },
|
||||
|
||||
'ThePrimeagen/vim-be-good',
|
||||
-- { 'stevearc/dressing.nvim', opts = {}, },
|
||||
|
||||
-- 'ThePrimeagen/vim-be-good',
|
||||
-- { 'vuciv/golf' },
|
||||
|
||||
require('config.plugins.oil'),
|
||||
require('config.plugins.git'),
|
||||
require('config.plugins.ui'),
|
||||
require('config.plugins.telescope'),
|
||||
|
@ -45,20 +46,10 @@ require('lazy').setup({
|
|||
require('config.plugins.languages.treesitter'),
|
||||
require('config.plugins.harpoon'),
|
||||
require('config.plugins.autosession'),
|
||||
require('config.plugins.snacks'),
|
||||
require('config.plugins.mini'),
|
||||
|
||||
require('config.plugins.languages.molten'),
|
||||
require('config.plugins.languages.flutter'),
|
||||
|
||||
|
||||
-- NOTE: maybe revisit this later
|
||||
-- {
|
||||
-- 'brenton-leighton/multiple-cursors.nvim',
|
||||
-- version = '*', -- Use the latest tagged version
|
||||
-- opts = {
|
||||
-- custom_key_maps = keymaps.multicursor_custom()
|
||||
-- }, -- This causes the plugin setup function to be called
|
||||
-- keys = keymaps.multicursor(),
|
||||
-- },
|
||||
|
||||
|
||||
})
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
return {
|
||||
'nvim-flutter/flutter-tools.nvim',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'stevearc/dressing.nvim', -- optional for vim.ui.select
|
||||
},
|
||||
dependencies = { 'nvim-lua/plenary.nvim', },
|
||||
config = function()
|
||||
require('flutter-tools').setup({})
|
||||
vim.keymap.set('n', '<leader>fd', '<cmd>FlutterDevices<CR>', { desc = 'show flutter devices' })
|
||||
vim.keymap.set('n', '<leader>fq', '<cmd>FlutterQuit<CR>', { desc = 'stop flutter' })
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ return {
|
|||
emmet_language_server = {},
|
||||
html = { filetypes = { 'html', 'htmldjango' }, },
|
||||
cssls = {},
|
||||
vtsls = {},
|
||||
|
||||
-- -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
--
|
||||
|
|
|
@ -3,15 +3,31 @@ return {
|
|||
build = ':TSUpdate',
|
||||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||
opts = {
|
||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'css', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'rust', 'python', 'htmldjango', 'r', 'dart' },
|
||||
auto_install = false,
|
||||
highlight = {
|
||||
enable = true,
|
||||
-- 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' },
|
||||
ensure_installed = {
|
||||
'bash',
|
||||
'c',
|
||||
'diff',
|
||||
'html',
|
||||
'css',
|
||||
'lua',
|
||||
'luadoc',
|
||||
'markdown',
|
||||
'markdown_inline',
|
||||
'query',
|
||||
'vim',
|
||||
'vimdoc',
|
||||
'rust',
|
||||
'python',
|
||||
'htmldjango',
|
||||
'r',
|
||||
'dart',
|
||||
'javascript',
|
||||
'typescript',
|
||||
'tsx',
|
||||
'regex'
|
||||
},
|
||||
auto_install = false,
|
||||
highlight = { enable = true, },
|
||||
indent = { enable = true },
|
||||
},
|
||||
-- There are additional nvim-treesitter modules that you can use to interact
|
||||
|
|
34
.config/nvim/lua/config/plugins/mini.lua
Normal file
34
.config/nvim/lua/config/plugins/mini.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
return {
|
||||
'echasnovski/mini.nvim',
|
||||
version = '*' ,
|
||||
config = function()
|
||||
require('mini.pairs').setup({})
|
||||
require('mini.ai').setup({
|
||||
mappings = {
|
||||
around = 'a',
|
||||
inside = 'h',
|
||||
|
||||
around_next = 'an',
|
||||
inside_next = 'hn',
|
||||
around_last = 'al',
|
||||
inside_last = 'hl',
|
||||
|
||||
goto_left = 'g[',
|
||||
goto_right = 'g]',
|
||||
},
|
||||
silent = true,
|
||||
})
|
||||
require('mini.surround').setup({
|
||||
silent = true,
|
||||
})
|
||||
require('mini.files').setup({
|
||||
mappings = {
|
||||
go_in = 'l',
|
||||
go_out = 'j',
|
||||
go_in_plus = 'L',
|
||||
go_out_plus = 'J',
|
||||
synchronize = '<C-s>'
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
return {
|
||||
'stevearc/oil.nvim',
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {
|
||||
use_default_keymaps = false,
|
||||
buf_options = {
|
||||
buflisted = true
|
||||
},
|
||||
keymaps = {
|
||||
['<C-j>'] = { '<Down><C-j>', remap = true },
|
||||
|
||||
['<Space>'] = { callback = function()
|
||||
local oil = require('oil')
|
||||
|
||||
local cursor_entry = oil.get_cursor_entry()
|
||||
|
||||
if not cursor_entry then
|
||||
return
|
||||
end
|
||||
if cursor_entry.type == 'directory' then
|
||||
oil.select()
|
||||
else
|
||||
oil.select(nil, function()
|
||||
vim.cmd.wincmd('h')
|
||||
local buf_name = vim.api.nvim_buf_get_name(0)
|
||||
local is_empty = buf_name == '' and not vim.bo.modified
|
||||
if is_empty then
|
||||
-- delete empty buffer
|
||||
vim.cmd('bd')
|
||||
else
|
||||
-- close window of not empty buffer
|
||||
vim.cmd('q')
|
||||
end
|
||||
end)
|
||||
end
|
||||
end, nowait = true },
|
||||
|
||||
-- shift space remapping
|
||||
['<F26>'] = 'actions.parent',
|
||||
|
||||
['<C-w>'] = { callback = function()
|
||||
vim.cmd('bd')
|
||||
end, nowait = true }
|
||||
}
|
||||
},
|
||||
-- dependencies = { { 'echasnovski/mini.icons', opts = {} } },
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
}
|
87
.config/nvim/lua/config/plugins/snacks.lua
Normal file
87
.config/nvim/lua/config/plugins/snacks.lua
Normal file
|
@ -0,0 +1,87 @@
|
|||
return {
|
||||
'folke/snacks.nvim',
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
|
||||
init = function()
|
||||
local Snacks = require('snacks')
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "SnacksInputRename",
|
||||
callback = function ()
|
||||
Snacks.config.input.win.relative = "cursor"
|
||||
Snacks.config.input.win.col = -1
|
||||
Snacks.config.input.win.row = -3
|
||||
Snacks.config.input.win.title_pos = 'left'
|
||||
end
|
||||
})
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "SnacksInputReset",
|
||||
callback = function ()
|
||||
Snacks.config.input.win.relative = "editor"
|
||||
Snacks.config.input.win.col = nil
|
||||
Snacks.config.input.win.row = 6
|
||||
Snacks.config.input.win.title_pos = 'center'
|
||||
end
|
||||
})
|
||||
end,
|
||||
|
||||
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
bigfile = { enabled = true },
|
||||
dashboard = {
|
||||
enabled = true,
|
||||
preset = {
|
||||
header = [[
|
||||
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
|
||||
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
|
||||
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
|
||||
██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
|
||||
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]],
|
||||
},
|
||||
sections = {
|
||||
{ section = 'header' },
|
||||
{ section = 'startup' },
|
||||
}
|
||||
},
|
||||
|
||||
indent = {
|
||||
enabled = true,
|
||||
animate = { enabled = false },
|
||||
},
|
||||
input = {
|
||||
enabled = true,
|
||||
win = {},
|
||||
},
|
||||
quickfile = { enabled = true },
|
||||
rename = { enabled = true },
|
||||
|
||||
bufdelete = { enabled = false },
|
||||
debug = { enabled = false },
|
||||
dim = { enabled = false },
|
||||
explorer = { enabled = false },
|
||||
git = { enabled = false },
|
||||
gitbrowse = { enabled = false },
|
||||
image = { enabled = false },
|
||||
layout = { enabled = false },
|
||||
lazygit = { enabled = false },
|
||||
notifier = { enabled = false },
|
||||
notify = { enabled = false },
|
||||
picker = { enabled = false },
|
||||
profiler = { enabled = false },
|
||||
scope = { enabled = false },
|
||||
scratch = { enabled = false },
|
||||
scroll = { enabled = false },
|
||||
statuscolumn = { enabled = false },
|
||||
terminal = { enabled = false },
|
||||
toggle = { enabled = false },
|
||||
win = { enabled = false },
|
||||
words = { enabled = false },
|
||||
zed = { enabled = false },
|
||||
},
|
||||
|
||||
}
|
|
@ -10,6 +10,7 @@ return {
|
|||
return vim.fn.executable 'make' == 1
|
||||
end,
|
||||
},
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
},
|
||||
config = function()
|
||||
local actions = require('telescope.actions')
|
||||
|
@ -28,9 +29,14 @@ return {
|
|||
['<C-v>'] = actions.file_vsplit
|
||||
}
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
['ui-select'] = { require('telescope.themes').get_dropdown({}) },
|
||||
}
|
||||
|
||||
})
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
pcall(require("telescope").load_extension('ui-select'))
|
||||
|
||||
-- NOTE: Mappings --
|
||||
|
||||
|
|
|
@ -1,22 +1,4 @@
|
|||
return {
|
||||
-- {
|
||||
-- 'akinsho/bufferline.nvim',
|
||||
-- version = "*",
|
||||
-- dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
-- opts = {
|
||||
-- options = {
|
||||
-- custom_filter = function(buf, _)
|
||||
-- local buf_name = vim.api.nvim_buf_get_name(buf)
|
||||
-- if string.find(buf_name, '^term://') or string.find(buf_name, '^oil://') then
|
||||
-- return false
|
||||
-- end
|
||||
-- return true
|
||||
-- end,
|
||||
-- show_buffer_close_icons = false,
|
||||
-- -- style_preset = require('bufferline').style_preset.minimal
|
||||
-- }
|
||||
-- }
|
||||
-- },
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue