Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 100 additions & 51 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.opt.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
vim.opt.relativenumber = true

-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
Expand Down Expand Up @@ -616,7 +616,10 @@ require('lazy').setup({
local servers = {
-- clangd = {},
-- gopls = {},
-- pyright = {},
pyright = {},
ruff = {},
debugpy = {},
taplo = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
Expand Down Expand Up @@ -709,7 +712,7 @@ require('lazy').setup({
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
python = { 'ruff_format', 'isort', 'black', stop_after_first = true },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
Expand Down Expand Up @@ -773,24 +776,24 @@ require('lazy').setup({
-- No, but seriously. Please read `:help ins-completion`, it is really good!
mapping = cmp.mapping.preset.insert {
-- Select the [n]ext item
['<C-n>'] = cmp.mapping.select_next_item(),
-- ['<C-n>'] = cmp.mapping.select_next_item(),
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),
-- ['<C-p>'] = cmp.mapping.select_prev_item(),

-- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- ['<C-b>'] = cmp.mapping.scroll_docs(-4),
-- ['<C-f>'] = cmp.mapping.scroll_docs(4),

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

-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
--['<CR>'] = cmp.mapping.confirm { select = true },
--['<Tab>'] = cmp.mapping.select_next_item(),
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
['<CR>'] = cmp.mapping.confirm { select = true },
['<Tab>'] = cmp.mapping.select_next_item(),
['<S-Tab>'] = cmp.mapping.select_prev_item(),

-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
Expand Down Expand Up @@ -829,6 +832,12 @@ require('lazy').setup({
{ name = 'luasnip' },
{ name = 'path' },
},
cmp.setup.filetype({ 'sql' }, {
sources = {
{ name = 'vim-dadbod-completion' },
{ name = 'buffer' },
},
}),
}
end,
},
Expand All @@ -838,13 +847,16 @@ require('lazy').setup({
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'folke/tokyonight.nvim',
-- 'folke/tokyonight.nvim',
'rose-pine/neovim',
priority = 1000, -- Make sure to load this before all the other start plugins.
init = function()
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night'
-- vim.cmd.colorscheme 'tokyonight-night'
-- vim.cmd.colorscheme 'rose-pine'
vim.cmd.colorscheme 'retrobox'

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

{ -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim',
config = function()
-- Better Around/Inside textobjects
--
-- Examples:
-- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
-- - ci' - [C]hange [I]nside [']quote
require('mini.ai').setup { n_lines = 500 }
-- { -- Collection of various small independent plugins/modules
-- 'echasnovski/mini.nvim',
-- config = function()
-- -- Better Around/Inside textobjects
-- --
-- -- Examples:
-- -- - va) - [V]isually select [A]round [)]paren
-- -- - yinq - [Y]ank [I]nside [N]ext [Q]uote
-- -- - ci' - [C]hange [I]nside [']quote
-- require('mini.ai').setup { n_lines = 500 }
--
-- -- Add/delete/replace surroundings (brackets, quotes, etc.)
-- --
-- -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- -- - sd' - [S]urround [D]elete [']quotes
-- -- - sr)' - [S]urround [R]eplace [)] [']
-- require('mini.surround').setup()
--
-- -- Simple and easy statusline.
-- -- You could remove this setup call if you don't like it,
-- -- and try some other statusline plugin
-- 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 }
--
-- -- You can configure sections in the statusline by overriding their
-- -- default behavior. For example, here we set the section for
-- -- cursor location to LINE:COLUMN
-- ---@diagnostic disable-next-line: duplicate-set-field
-- statusline.section_location = function()
-- return '%2l:%-2v'
-- end
--
-- -- ... and there is more!
-- -- Check out: https://github.com/echasnovski/mini.nvim
-- end,
-- },

-- Add/delete/replace surroundings (brackets, quotes, etc.)
--
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- - sd' - [S]urround [D]elete [']quotes
-- - sr)' - [S]urround [R]eplace [)] [']
require('mini.surround').setup()

-- Simple and easy statusline.
-- You could remove this setup call if you don't like it,
-- and try some other statusline plugin
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 }

-- You can configure sections in the statusline by overriding their
-- default behavior. For example, here we set the section for
-- cursor location to LINE:COLUMN
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return '%2l:%-2v'
end

-- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim
end,
},
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
ensure_installed = {
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'markdown_inline',
'query',
'vim',
'vimdoc',
'python',
'markdown_inline',
'markdown',
'rst',
'ninja',
},
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
Expand Down Expand Up @@ -937,7 +967,7 @@ require('lazy').setup({
-- This is the easiest way to modularize your config.
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
--
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope!
Expand Down Expand Up @@ -965,5 +995,24 @@ require('lazy').setup({
},
})

-- MiniMap = require 'mini.map'
-- vim.keymap.set('n', '<leader>mt', MiniMap.toggle, { desc = 'Toggle MiniMap' })
-- vim.keymap.set('n', '<leader>mo', MiniMap.open, { desc = 'Open MiniMap' })
-- vim.keymap.set('n', '<leader>mc', MiniMap.close, { desc = 'Close MiniMap' })
-- vim.keymap.set('n', '<leader>mf', MiniMap.toggle_focus, { desc = 'Toggle MiniMap Focus' })
-- vim.keymap.set('n', '<leader>mr', MiniMap.refresh, { desc = 'Refresh MiniMap' })
-- vim.keymap.set('n', '<leader>ms', MiniMap.toggle_side, { desc = 'Toggle MiniMap side' })
--
vim.api.nvim_create_user_command('LintProject', function()
vim.cmd '!poetry run task lint'
end, {})

vim.api.nvim_create_user_command('FormatProject', function()
vim.cmd '!poetry run task format'
end, {})

vim.api.nvim_create_user_command('ShowDiagnostic', function()
vim.cmd '!lua vim.diagnostic.open_float()'
end, {})
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
18 changes: 18 additions & 0 deletions lua/custom/plugins/blame.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
return {
{
'FabijanZulj/blame.nvim',
lazy = false,
config = function()
require('blame').setup()
end,
},
-- keys = {
-- {
-- '<leader>mt',
-- function()
-- vim.keymap.set('n', '<leader>bt', ':BlameToggle<CR>')
-- end,
-- desc = 'Toggle git blame window',
-- },
-- },
}
5 changes: 5 additions & 0 deletions lua/custom/plugins/dadbod.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
return {
'tpope/vim-dadbod',
'kristijanhusak/vim-dadbod-completion',
'kristijanhusak/vim-dadbod-ui',
}
21 changes: 21 additions & 0 deletions lua/custom/plugins/lazygit.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- nvim v0.8.0
return {
'kdheepak/lazygit.nvim',
lazy = true,
cmd = {
'LazyGit',
'LazyGitConfig',
'LazyGitCurrentFile',
'LazyGitFilter',
'LazyGitFilterCurrentFile',
},
-- optional for floating window border decoration
dependencies = {
'nvim-lua/plenary.nvim',
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ '<leader>lg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
},
}
77 changes: 77 additions & 0 deletions lua/custom/plugins/minimap.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
return {
'echasnovski/mini.map',
version = '*',
-- vim.keymap.set('n', '<leader>mo', MiniMap.open, { desc = 'Open MiniMap' }),
config = function()
-- require('mini.map').setup()
local map = require 'mini.map'

local diagnostic_integration = map.gen_integration.diagnostic {
error = 'DiagnosticFloatingError',
warn = 'DiagnosticFloatingWarn',
info = 'DiagnosticFloatingInfo',
hint = 'DiagnosticFloatingHint',
}

local builtin_search_integration = map.gen_integration.builtin_search()

local gitsigns_integration = map.gen_integration.gitsigns {
add = 'GitSignsAdd',
change = 'GitSignsChange',
delete = 'GitSignsDelete',
}

map.setup {
integrations = {
diagnostic_integration,
builtin_search_integration,
gitsigns_integration,
},
}
end,

keys = {
{
'<leader>mt',
function()
require('mini.map').toggle()
end,
desc = 'Toggle minimap',
},
{
'<leader>mc',
function()
require('mini.map').close()
end,
desc = 'Close minimap',
},
{
'<leader>mf',
function()
require('mini.map').toggle_focus()
end,
desc = 'Toggle minimap focus',
},
{
'<leader>mo',
function()
require('mini.map').open()
end,
desc = 'Open minimap',
},
{
'<leader>mr',
function()
require('mini.map').refresh()
end,
desc = 'Refresh minimap',
},
{
'<leader>ms',
function()
require('mini.map').toggle_side()
end,
desc = 'Toggle minimap side',
},
},
}
Loading
Loading