Skip to content

Commit 6d8dc4e

Browse files
adds oil, blame, lazygit, and minimap
1 parent 2ba39c6 commit 6d8dc4e

File tree

6 files changed

+275
-51
lines changed

6 files changed

+275
-51
lines changed

init.lua

Lines changed: 100 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
102102
vim.opt.number = true
103103
-- You can also add relative line numbers, to help with jumping.
104104
-- Experiment for yourself to see if you like it!
105-
-- vim.opt.relativenumber = true
105+
vim.opt.relativenumber = true
106106

107107
-- Enable mouse mode, can be useful for resizing splits for example!
108108
vim.opt.mouse = 'a'
@@ -616,7 +616,10 @@ require('lazy').setup({
616616
local servers = {
617617
-- clangd = {},
618618
-- gopls = {},
619-
-- pyright = {},
619+
pyright = {},
620+
ruff = {},
621+
debugpy = {},
622+
taplo = {},
620623
-- rust_analyzer = {},
621624
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
622625
--
@@ -709,7 +712,7 @@ require('lazy').setup({
709712
formatters_by_ft = {
710713
lua = { 'stylua' },
711714
-- Conform can also run multiple formatters sequentially
712-
-- python = { "isort", "black" },
715+
python = { 'ruff_format', 'isort', 'black', stop_after_first = true },
713716
--
714717
-- You can use 'stop_after_first' to run the first available formatter from the list
715718
-- javascript = { "prettierd", "prettier", stop_after_first = true },
@@ -773,24 +776,24 @@ require('lazy').setup({
773776
-- No, but seriously. Please read `:help ins-completion`, it is really good!
774777
mapping = cmp.mapping.preset.insert {
775778
-- Select the [n]ext item
776-
['<C-n>'] = cmp.mapping.select_next_item(),
779+
-- ['<C-n>'] = cmp.mapping.select_next_item(),
777780
-- Select the [p]revious item
778-
['<C-p>'] = cmp.mapping.select_prev_item(),
781+
-- ['<C-p>'] = cmp.mapping.select_prev_item(),
779782

780783
-- Scroll the documentation window [b]ack / [f]orward
781-
['<C-b>'] = cmp.mapping.scroll_docs(-4),
782-
['<C-f>'] = cmp.mapping.scroll_docs(4),
784+
-- ['<C-b>'] = cmp.mapping.scroll_docs(-4),
785+
-- ['<C-f>'] = cmp.mapping.scroll_docs(4),
783786

784787
-- Accept ([y]es) the completion.
785788
-- This will auto-import if your LSP supports it.
786789
-- This will expand snippets if the LSP sent a snippet.
787-
['<C-y>'] = cmp.mapping.confirm { select = true },
790+
-- ['<C-y>'] = cmp.mapping.confirm { select = true },
788791

789792
-- If you prefer more traditional completion keymaps,
790793
-- you can uncomment the following lines
791-
--['<CR>'] = cmp.mapping.confirm { select = true },
792-
--['<Tab>'] = cmp.mapping.select_next_item(),
793-
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
794+
['<CR>'] = cmp.mapping.confirm { select = true },
795+
['<Tab>'] = cmp.mapping.select_next_item(),
796+
['<S-Tab>'] = cmp.mapping.select_prev_item(),
794797

795798
-- Manually trigger a completion from nvim-cmp.
796799
-- Generally you don't need this, because nvim-cmp will display
@@ -829,6 +832,12 @@ require('lazy').setup({
829832
{ name = 'luasnip' },
830833
{ name = 'path' },
831834
},
835+
cmp.setup.filetype({ 'sql' }, {
836+
sources = {
837+
{ name = 'vim-dadbod-completion' },
838+
{ name = 'buffer' },
839+
},
840+
}),
832841
}
833842
end,
834843
},
@@ -838,13 +847,16 @@ require('lazy').setup({
838847
-- change the command in the config to whatever the name of that colorscheme is.
839848
--
840849
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
841-
'folke/tokyonight.nvim',
850+
-- 'folke/tokyonight.nvim',
851+
'rose-pine/neovim',
842852
priority = 1000, -- Make sure to load this before all the other start plugins.
843853
init = function()
844854
-- Load the colorscheme here.
845855
-- Like many other themes, this one has different styles, and you could load
846856
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
847-
vim.cmd.colorscheme 'tokyonight-night'
857+
-- vim.cmd.colorscheme 'tokyonight-night'
858+
-- vim.cmd.colorscheme 'rose-pine'
859+
vim.cmd.colorscheme 'retrobox'
848860

849861
-- You can configure highlights by doing something like:
850862
vim.cmd.hi 'Comment gui=none'
@@ -854,50 +866,68 @@ require('lazy').setup({
854866
-- Highlight todo, notes, etc in comments
855867
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
856868

857-
{ -- Collection of various small independent plugins/modules
858-
'echasnovski/mini.nvim',
859-
config = function()
860-
-- Better Around/Inside textobjects
861-
--
862-
-- Examples:
863-
-- - va) - [V]isually select [A]round [)]paren
864-
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
865-
-- - ci' - [C]hange [I]nside [']quote
866-
require('mini.ai').setup { n_lines = 500 }
869+
-- { -- Collection of various small independent plugins/modules
870+
-- 'echasnovski/mini.nvim',
871+
-- config = function()
872+
-- -- Better Around/Inside textobjects
873+
-- --
874+
-- -- Examples:
875+
-- -- - va) - [V]isually select [A]round [)]paren
876+
-- -- - yinq - [Y]ank [I]nside [N]ext [Q]uote
877+
-- -- - ci' - [C]hange [I]nside [']quote
878+
-- require('mini.ai').setup { n_lines = 500 }
879+
--
880+
-- -- Add/delete/replace surroundings (brackets, quotes, etc.)
881+
-- --
882+
-- -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
883+
-- -- - sd' - [S]urround [D]elete [']quotes
884+
-- -- - sr)' - [S]urround [R]eplace [)] [']
885+
-- require('mini.surround').setup()
886+
--
887+
-- -- Simple and easy statusline.
888+
-- -- You could remove this setup call if you don't like it,
889+
-- -- and try some other statusline plugin
890+
-- local statusline = require 'mini.statusline'
891+
-- -- set use_icons to true if you have a Nerd Font
892+
-- statusline.setup { use_icons = vim.g.have_nerd_font }
893+
--
894+
-- -- You can configure sections in the statusline by overriding their
895+
-- -- default behavior. For example, here we set the section for
896+
-- -- cursor location to LINE:COLUMN
897+
-- ---@diagnostic disable-next-line: duplicate-set-field
898+
-- statusline.section_location = function()
899+
-- return '%2l:%-2v'
900+
-- end
901+
--
902+
-- -- ... and there is more!
903+
-- -- Check out: https://github.com/echasnovski/mini.nvim
904+
-- end,
905+
-- },
867906

868-
-- Add/delete/replace surroundings (brackets, quotes, etc.)
869-
--
870-
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
871-
-- - sd' - [S]urround [D]elete [']quotes
872-
-- - sr)' - [S]urround [R]eplace [)] [']
873-
require('mini.surround').setup()
874-
875-
-- Simple and easy statusline.
876-
-- You could remove this setup call if you don't like it,
877-
-- and try some other statusline plugin
878-
local statusline = require 'mini.statusline'
879-
-- set use_icons to true if you have a Nerd Font
880-
statusline.setup { use_icons = vim.g.have_nerd_font }
881-
882-
-- You can configure sections in the statusline by overriding their
883-
-- default behavior. For example, here we set the section for
884-
-- cursor location to LINE:COLUMN
885-
---@diagnostic disable-next-line: duplicate-set-field
886-
statusline.section_location = function()
887-
return '%2l:%-2v'
888-
end
889-
890-
-- ... and there is more!
891-
-- Check out: https://github.com/echasnovski/mini.nvim
892-
end,
893-
},
894907
{ -- Highlight, edit, and navigate code
895908
'nvim-treesitter/nvim-treesitter',
896909
build = ':TSUpdate',
897910
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
898911
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
899912
opts = {
900-
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
913+
ensure_installed = {
914+
'bash',
915+
'c',
916+
'diff',
917+
'html',
918+
'lua',
919+
'luadoc',
920+
'markdown',
921+
'markdown_inline',
922+
'query',
923+
'vim',
924+
'vimdoc',
925+
'python',
926+
'markdown_inline',
927+
'markdown',
928+
'rst',
929+
'ninja',
930+
},
901931
-- Autoinstall languages that are not installed
902932
auto_install = true,
903933
highlight = {
@@ -937,7 +967,7 @@ require('lazy').setup({
937967
-- This is the easiest way to modularize your config.
938968
--
939969
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
940-
-- { import = 'custom.plugins' },
970+
{ import = 'custom.plugins' },
941971
--
942972
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
943973
-- Or use telescope!
@@ -965,5 +995,24 @@ require('lazy').setup({
965995
},
966996
})
967997

998+
-- MiniMap = require 'mini.map'
999+
-- vim.keymap.set('n', '<leader>mt', MiniMap.toggle, { desc = 'Toggle MiniMap' })
1000+
-- vim.keymap.set('n', '<leader>mo', MiniMap.open, { desc = 'Open MiniMap' })
1001+
-- vim.keymap.set('n', '<leader>mc', MiniMap.close, { desc = 'Close MiniMap' })
1002+
-- vim.keymap.set('n', '<leader>mf', MiniMap.toggle_focus, { desc = 'Toggle MiniMap Focus' })
1003+
-- vim.keymap.set('n', '<leader>mr', MiniMap.refresh, { desc = 'Refresh MiniMap' })
1004+
-- vim.keymap.set('n', '<leader>ms', MiniMap.toggle_side, { desc = 'Toggle MiniMap side' })
1005+
--
1006+
vim.api.nvim_create_user_command('LintProject', function()
1007+
vim.cmd '!poetry run task lint'
1008+
end, {})
1009+
1010+
vim.api.nvim_create_user_command('FormatProject', function()
1011+
vim.cmd '!poetry run task format'
1012+
end, {})
1013+
1014+
vim.api.nvim_create_user_command('ShowDiagnostic', function()
1015+
vim.cmd '!lua vim.diagnostic.open_float()'
1016+
end, {})
9681017
-- The line beneath this is called `modeline`. See `:help modeline`
9691018
-- vim: ts=2 sts=2 sw=2 et

lua/custom/plugins/blame.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
return {
2+
{
3+
'FabijanZulj/blame.nvim',
4+
lazy = false,
5+
config = function()
6+
require('blame').setup()
7+
end,
8+
},
9+
-- keys = {
10+
-- {
11+
-- '<leader>mt',
12+
-- function()
13+
-- vim.keymap.set('n', '<leader>bt', ':BlameToggle<CR>')
14+
-- end,
15+
-- desc = 'Toggle git blame window',
16+
-- },
17+
-- },
18+
}

lua/custom/plugins/dadbod.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
return {
2+
'tpope/vim-dadbod',
3+
'kristijanhusak/vim-dadbod-completion',
4+
'kristijanhusak/vim-dadbod-ui',
5+
}

lua/custom/plugins/lazygit.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- nvim v0.8.0
2+
return {
3+
'kdheepak/lazygit.nvim',
4+
lazy = true,
5+
cmd = {
6+
'LazyGit',
7+
'LazyGitConfig',
8+
'LazyGitCurrentFile',
9+
'LazyGitFilter',
10+
'LazyGitFilterCurrentFile',
11+
},
12+
-- optional for floating window border decoration
13+
dependencies = {
14+
'nvim-lua/plenary.nvim',
15+
},
16+
-- setting the keybinding for LazyGit with 'keys' is recommended in
17+
-- order to load the plugin when the command is run for the first time
18+
keys = {
19+
{ '<leader>lg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
20+
},
21+
}

lua/custom/plugins/minimap.lua

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
return {
2+
'echasnovski/mini.map',
3+
version = '*',
4+
-- vim.keymap.set('n', '<leader>mo', MiniMap.open, { desc = 'Open MiniMap' }),
5+
config = function()
6+
-- require('mini.map').setup()
7+
local map = require 'mini.map'
8+
9+
local diagnostic_integration = map.gen_integration.diagnostic {
10+
error = 'DiagnosticFloatingError',
11+
warn = 'DiagnosticFloatingWarn',
12+
info = 'DiagnosticFloatingInfo',
13+
hint = 'DiagnosticFloatingHint',
14+
}
15+
16+
local builtin_search_integration = map.gen_integration.builtin_search()
17+
18+
local gitsigns_integration = map.gen_integration.gitsigns {
19+
add = 'GitSignsAdd',
20+
change = 'GitSignsChange',
21+
delete = 'GitSignsDelete',
22+
}
23+
24+
map.setup {
25+
integrations = {
26+
diagnostic_integration,
27+
builtin_search_integration,
28+
gitsigns_integration,
29+
},
30+
}
31+
end,
32+
33+
keys = {
34+
{
35+
'<leader>mt',
36+
function()
37+
require('mini.map').toggle()
38+
end,
39+
desc = 'Toggle minimap',
40+
},
41+
{
42+
'<leader>mc',
43+
function()
44+
require('mini.map').close()
45+
end,
46+
desc = 'Close minimap',
47+
},
48+
{
49+
'<leader>mf',
50+
function()
51+
require('mini.map').toggle_focus()
52+
end,
53+
desc = 'Toggle minimap focus',
54+
},
55+
{
56+
'<leader>mo',
57+
function()
58+
require('mini.map').open()
59+
end,
60+
desc = 'Open minimap',
61+
},
62+
{
63+
'<leader>mr',
64+
function()
65+
require('mini.map').refresh()
66+
end,
67+
desc = 'Refresh minimap',
68+
},
69+
{
70+
'<leader>ms',
71+
function()
72+
require('mini.map').toggle_side()
73+
end,
74+
desc = 'Toggle minimap side',
75+
},
76+
},
77+
}

0 commit comments

Comments
 (0)