Skip to content

Commit

Permalink
tweaks including aerial, cd in mini.files
Browse files Browse the repository at this point in the history
  • Loading branch information
iofq committed Sep 6, 2024
1 parent 6d8480b commit 6831ace
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 113 deletions.
34 changes: 0 additions & 34 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
url = "github:mrcjkb/nix-gen-luarc-json";
inputs.nixpkgs.follows = "nixpkgs";
};
snipe-nvim = {
url = "github:leath-dub/snipe.nvim";
flake = false;
};
nvim-early-retirement = {
url = "github:chrisgrieser/nvim-early-retirement";
flake = false;
};
workspace-diagnostics-nvim = {
url = "github:artemave/workspace-diagnostics.nvim";
flake = false;
Expand Down
6 changes: 1 addition & 5 deletions nix/neovim-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ with final.pkgs.lib; let
inherit pname src;
version = src.lastModifiedDate;
};
snipe-nvim = mkNvimPlugin inputs.snipe-nvim "snipe-nvim";
nvim-early-retirement = mkNvimPlugin inputs.nvim-early-retirement "nvim-early-retirement";
workspace-diagnostics-nvim = mkNvimPlugin inputs.workspace-diagnostics-nvim "workspace-diagnostics-nvim";

mkNeovim = pkgs.callPackage ./mkNeovim.nix { inherit pkgs-wrapNeovim; };

all-plugins = with pkgs.vimPlugins; [
aerial-nvim
cmp-buffer
cmp-cmdline
cmp-nvim-lsp
Expand All @@ -40,7 +39,6 @@ with final.pkgs.lib; let
nvim-dap
nvim-dap-go
nvim-dap-ui
nvim-early-retirement
nvim-lspconfig
nvim-nio
nvim-treesitter-context
Expand Down Expand Up @@ -72,9 +70,7 @@ with final.pkgs.lib; let
tree-sitter-typescript
tree-sitter-yaml
]))
outline-nvim
scope-nvim
snipe-nvim
telescope-fzf-native-nvim
telescope-nvim
toggleterm-nvim
Expand Down
24 changes: 10 additions & 14 deletions nvim/lua/config/init.lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
vim.opt.backspace = 'indent,eol,start'
vim.opt.clipboard = 'unnamedplus'
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
vim.opt.expandtab = true -- insert tabs as spaces
vim.opt.inccommand = 'split' -- incremental live completion
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
vim.opt.expandtab = true -- insert tabs as spaces
vim.opt.inccommand = 'split' -- incremental live completion
vim.opt.list = true
vim.opt.nrformats:append('alpha') -- let Ctrl-a do letters as well
vim.opt.path:append('**') -- enable fuzzy :find ing
vim.opt.path:append('**') -- enable fuzzy :find ing
vim.opt.relativenumber = true
vim.opt.shadafile = 'NONE' -- disable shada
vim.opt.shiftwidth = 0 -- >> shifts by tabstop
vim.opt.showmatch = true -- highlight matching brackets
vim.opt.showmode = false
vim.opt.shadafile = 'NONE' -- disable shada
vim.opt.shiftwidth = 0 -- >> shifts by tabstop
vim.opt.showmatch = true -- highlight matching brackets
vim.opt.signcolumn = 'no'
vim.opt.spell = false
vim.opt.softtabstop = -1 -- backspace removes tabstop
vim.opt.softtabstop = -1 -- backspace removes tabstop
vim.opt.swapfile = false
vim.opt.tabstop = 2 -- 2 space tabs are based
vim.opt.updatetime = 250 -- decrease update time
vim.opt.tabstop = 2 -- 2 space tabs are based
vim.opt.updatetime = 250 -- decrease update time
vim.opt.virtualedit = 'onemore'
vim.opt.wrap = true
vim.g.fzf_layout = { window = { width = 0.9, height = 0.6 } }

-- Switch tab length on the fly
vim.keymap.set('n', '\\t', function()
Expand Down
2 changes: 1 addition & 1 deletion nvim/lua/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ return {
},
},
sources = cmp.config.sources({
{ name = 'nvim_lsp', keyword_length = 1 },
{ name = 'nvim_lsp', keyword_length = 1 },
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'path' },
Expand Down
4 changes: 0 additions & 4 deletions nvim/lua/plugins/debug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ return {
ui.toggle()
end, { desc = 'toggle dapui' })
vim.keymap.set('n', '<leader>zz', function()
scopes = w.sidebar(w.scopes, {}, 'split')
d.continue()
end, { desc = 'start debugger' })
vim.keymap.set('n', '<leader>zn', function()
Expand Down Expand Up @@ -53,9 +52,6 @@ return {
local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.frames)
end, { desc = 'view frames' })
vim.keymap.set('n', '<leader>zs', function()
scopes.toggle()
end, { desc = 'toggle scope view' })
end,
},
}
7 changes: 1 addition & 6 deletions nvim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ return {
event = 'VeryLazy',
dependencies = {
'hrsh7th/cmp-nvim-lsp',
'artemave/workspace-diagnostics.nvim',
},
config = function()
local lspconfig = require('lspconfig')
Expand Down Expand Up @@ -133,12 +134,6 @@ return {
'<cmd>Telescope lsp_references<cr>',
{ buffer = ev.buf, noremap = true, silent = true, desc = 'LSP references' }
)
vim.keymap.set(
'n',
'<leader>dt',
'<cmd>Telescope lsp_type_definitions<cr>',
{ buffer = ev.buf, noremap = true, silent = true, desc = 'LSP type defs' }
)
vim.keymap.set(
'n',
'<leader>ds',
Expand Down
21 changes: 19 additions & 2 deletions nvim/lua/plugins/mini.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ return {
{ mode = 'n', keys = '<C-w>' },
{ mode = 'n', keys = 'z' },
},

window = {
config = { width = 'auto', },
},
clues = {
miniclue.gen_clues.g(),
miniclue.gen_clues.marks(),
Expand Down Expand Up @@ -110,11 +112,11 @@ return {
local files = require("mini.files")
files.setup {
mappings = {
synchronize = "w",
go_in_plus = "<CR>"
},
windows = {
preview = true,
width_focus = 30,
width_preview = 50,
}
}
Expand All @@ -133,6 +135,21 @@ return {
)
end,
})
vim.api.nvim_create_autocmd("User", {
pattern = "MiniFilesBufferCreate",
callback = function(args)
vim.keymap.set(
"n",
"`",
function()
local cur_entry_path = MiniFiles.get_fs_entry().path
local cur_directory = vim.fs.dirname(cur_entry_path)
vim.fn.chdir(cur_directory)
end,
{ buffer = args.data.buf_id }
)
end,
})
end)
end,
},
Expand Down
47 changes: 15 additions & 32 deletions nvim/lua/plugins/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ return {
'akinsho/toggleterm.nvim',
event = 'VeryLazy',
opts = {
open_mapping = [[<C-\>]],
direction = 'float',
close_on_exit = true,
autochdir = true,
Expand All @@ -35,28 +34,6 @@ return {
}
},
{ 'tiagovla/scope.nvim', event = 'VeryLazy', config = true },
{
'chrisgrieser/nvim-early-retirement',
event = 'VeryLazy',
opts = { minimumBufferNum = 10 },
},
{
'leath-dub/snipe.nvim',
event = 'VeryLazy',
opts = {
sort = 'last',
},
config = function(_, opts)
local snipe = require('snipe')
snipe.setup(opts)
vim.keymap.set(
'n',
'<leader>fb',
snipe.open_buffer_menu,
{ noremap = true, silent = true, desc = 'Pick buffers (snipe.nvim)' }
)
end,
},
{
'sindrets/diffview.nvim',
event = 'VeryLazy',
Expand Down Expand Up @@ -149,6 +126,7 @@ return {
local gs = package.loaded.gitsigns
vim.keymap.set('n', '<leader>gg', gs.preview_hunk, { desc = 'git preview hunk' })
vim.keymap.set('n', '<leader>gr', gs.reset_hunk, { desc = 'git reset hunk' })
vim.keymap.set('n', '<leader>gs', gs.stage_hunk, { desc = 'git stage hunk' })
vim.keymap.set('n', '<leader>gd', gs.diffthis, { desc = 'git diff hunk' })
vim.keymap.set('n', '<leader>gb', function()
gs.blame_line { full = true }
Expand All @@ -164,7 +142,7 @@ return {
return ']c'
end
vim.schedule(function()
gs.next_hunk()
gs.next_hunk({ target = 'all' })
end)
return '<Ignore>'
end, { expr = true })
Expand All @@ -174,25 +152,30 @@ return {
return '[c'
end
vim.schedule(function()
gs.prev_hunk()
gs.prev_hunk({ target = 'all' })
end)
return '<Ignore>'
end, { expr = true })
end,
},
},
{
'hedyhli/outline.nvim',
cmd = { 'Outline', 'OutlineOpen' },
'stevearc/aerial.nvim',
cmd = { 'AerialToggle' },
keys = {
{ '<leader>no', '<cmd>Outline<CR>', desc = 'Toggle outline' },
{ '<leader>na', '<cmd>AerialToggle<CR>', desc = 'Toggle aerial' },
},
opts = {
outline_window = {
position = 'left',
width = 30,
auto_close = true,
backends = {
"lsp",
"treesitter",
"markdown"
},
filter_kind = false,
layout = {
default_direction = "left",
},
autojump = true,
},
},
}
8 changes: 1 addition & 7 deletions nvim/lua/plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ return {
storage = "memory",
},
})
vim.keymap.set({"n","x"}, "y", "<Plug>(YankyYank)")
vim.keymap.set({ "n", "x" }, "y", "<Plug>(YankyYank)")
end,
},
},
Expand Down Expand Up @@ -93,12 +93,6 @@ return {
b.find_files,
{ noremap = true, silent = true, desc = 'Fuzzy find files' }
)
vim.keymap.set(
'n',
'<leader>fc',
b.command_history,
{ noremap = true, silent = true, desc = 'Fuzzy find command_history' }
)
vim.keymap.set(
'n',
'<leader>fa',
Expand Down

0 comments on commit 6831ace

Please sign in to comment.