Skip to content

Commit 9e52560

Browse files
committed
Added more plugins
1 parent d350db2 commit 9e52560

File tree

8 files changed

+260
-42
lines changed

8 files changed

+260
-42
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ too - it's ignored in the kickstart repo to make maintenance easier, but it's
7373
<details><summary> Linux and Mac </summary>
7474

7575
```sh
76-
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
76+
git clone https://github.com/wojtek0123/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
7777
```
7878

7979
</details>

init.lua

Lines changed: 66 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ vim.opt.inccommand = 'split'
154154
vim.opt.cursorline = true
155155

156156
-- Minimal number of screen lines to keep above and below the cursor.
157-
vim.opt.scrolloff = 10
157+
vim.opt.scrolloff = 99999999
158158

159159
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
160160
-- instead raise a dialog asking if you wish to save the current file(s)
@@ -399,11 +399,19 @@ require('lazy').setup({
399399
-- You can put your default mappings / updates / etc. in here
400400
-- All the info you're looking for is in `:help telescope.setup()`
401401
--
402-
-- defaults = {
403-
-- mappings = {
404-
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
405-
-- },
406-
-- },
402+
defaults = {
403+
mappings = {
404+
i = { ['<c-enter>'] = 'to_fuzzy_refine' },
405+
n = {
406+
-- I'm used to closing buffers with "d" from bufexplorer
407+
['d'] = require('telescope.actions').delete_buffer,
408+
-- I'm also used to quitting bufexplorer with q instead of escape
409+
['q'] = require('telescope.actions').close,
410+
['v'] = require('telescope.actions').select_vertical,
411+
['h'] = require('telescope.actions').select_horizontal,
412+
},
413+
},
414+
},
407415
-- pickers = {}
408416
extensions = {
409417
['ui-select'] = {
@@ -827,7 +835,9 @@ require('lazy').setup({
827835
-- <c-k>: Toggle signature help
828836
--
829837
-- See :h blink-cmp-config-keymap for defining your own keymap
830-
preset = 'default',
838+
preset = 'enter',
839+
['<S-Tab>'] = { 'select_prev', 'fallback' },
840+
['<Tab>'] = { 'select_next', 'fallback' },
831841

832842
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
833843
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
@@ -868,25 +878,13 @@ require('lazy').setup({
868878
},
869879
},
870880

871-
{ -- You can easily change to a different colorscheme.
872-
-- Change the name of the colorscheme plugin below, and then
873-
-- change the command in the config to whatever the name of that colorscheme is.
874-
--
875-
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
876-
'folke/tokyonight.nvim',
877-
priority = 1000, -- Make sure to load this before all the other start plugins.
881+
{
882+
'catppuccin/nvim',
883+
lazy = false,
884+
name = 'catppuccin',
885+
priority = 1000,
878886
config = function()
879-
---@diagnostic disable-next-line: missing-fields
880-
require('tokyonight').setup {
881-
styles = {
882-
comments = { italic = false }, -- Disable italics in comments
883-
},
884-
}
885-
886-
-- Load the colorscheme here.
887-
-- Like many other themes, this one has different styles, and you could load
888-
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
889-
vim.cmd.colorscheme 'tokyonight-night'
887+
vim.cmd.colorscheme 'catppuccin-frappe'
890888
end,
891889
},
892890

@@ -916,7 +914,41 @@ require('lazy').setup({
916914
-- and try some other statusline plugin
917915
local statusline = require 'mini.statusline'
918916
-- set use_icons to true if you have a Nerd Font
919-
statusline.setup { use_icons = vim.g.have_nerd_font }
917+
statusline.setup { use_icons = true }
918+
919+
local function get_winbar_path()
920+
local full_path = vim.fn.expand '%:p'
921+
return full_path:gsub(vim.fn.expand '$HOME', '~')
922+
end
923+
-- Function to get the number of open buffers using the :ls command
924+
local function get_buffer_count()
925+
local buffers = vim.fn.execute 'ls'
926+
local count = 0
927+
-- Match only lines that represent buffers, typically starting with a number followed by a space
928+
for line in string.gmatch(buffers, '[^\r\n]+') do
929+
if string.match(line, '^%s*%d+') then
930+
count = count + 1
931+
end
932+
end
933+
return count
934+
end
935+
-- Function to update the winbar
936+
local function update_winbar()
937+
local home_replaced = get_winbar_path()
938+
local buffer_count = get_buffer_count()
939+
940+
local path = '%#WinBar2#(' .. buffer_count .. ') ' .. '%#WinBar1#' .. home_replaced .. '%*%=%#WinBar2#'
941+
942+
-- Override the section_filename function to disable file path
943+
---@diagnostic disable-next-line: duplicate-set-field
944+
statusline.section_filename = function()
945+
return path
946+
end
947+
end
948+
-- Autocmd to update the winbar on BufEnter and WinEnter events
949+
vim.api.nvim_create_autocmd({ 'BufEnter', 'WinEnter' }, {
950+
callback = update_winbar,
951+
})
920952

921953
-- You can configure sections in the statusline by overriding their
922954
-- default behavior. For example, here we set the section for
@@ -944,9 +976,9 @@ require('lazy').setup({
944976
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
945977
-- If you are experiencing weird indenting issues, add the language to
946978
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
947-
additional_vim_regex_highlighting = { 'ruby' },
979+
additional_vim_regex_highlighting = false,
948980
},
949-
indent = { enable = true, disable = { 'ruby' } },
981+
indent = { enable = true },
950982
},
951983
-- There are additional nvim-treesitter modules that you can use to interact
952984
-- with nvim-treesitter. You should go explore a few and see what interests you:
@@ -966,17 +998,17 @@ require('lazy').setup({
966998
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
967999
--
9681000
-- require 'kickstart.plugins.debug',
969-
-- require 'kickstart.plugins.indent_line',
970-
-- require 'kickstart.plugins.lint',
971-
-- require 'kickstart.plugins.autopairs',
972-
-- require 'kickstart.plugins.neo-tree',
973-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
1001+
require 'kickstart.plugins.indent_line',
1002+
require 'kickstart.plugins.lint',
1003+
require 'kickstart.plugins.autopairs',
1004+
require 'kickstart.plugins.neo-tree',
1005+
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
9741006

9751007
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
9761008
-- This is the easiest way to modularize your config.
9771009
--
9781010
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
979-
-- { import = 'custom.plugins' },
1011+
{ import = 'custom.plugins' },
9801012
--
9811013
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
9821014
-- Or use telescope!

lua/custom/plugins/autopairs.lua

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
return {
2+
'windwp/nvim-autopairs',
3+
event = 'InsertEnter',
4+
dependencies = {
5+
'hrsh7th/nvim-cmp',
6+
},
7+
config = function()
8+
local autopairs = require 'nvim-autopairs'
9+
10+
autopairs.setup {
11+
check_ts = true, -- enable treesitter
12+
ts_config = {
13+
lua = { 'string' }, -- don't add pairs in lua string treesitter nodes
14+
javascript = { 'template_string' }, -- don't add pairs in javscript template_string treesitter nodes
15+
java = false, -- don't check treesitter on java
16+
},
17+
}
18+
19+
-- import nvim-autopairs completion functionality
20+
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
21+
22+
-- import nvim-cmp plugin (completions plugin)
23+
local cmp = require 'cmp'
24+
25+
-- make autopairs and completion work together
26+
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
27+
end,
28+
}

lua/custom/plugins/flash.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
return {
2+
'folke/flash.nvim',
3+
event = 'VeryLazy',
4+
---@type Flash.Config
5+
opts = {},
6+
-- stylua: ignore
7+
keys = {
8+
{ "gs", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
9+
{ "gS", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
10+
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
11+
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
12+
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
13+
},
14+
}

lua/custom/plugins/init.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
-- I promise not to create any merge conflicts in this directory :)
33
--
44
-- See the kickstart.nvim README for more information
5-
return {}
5+
return {
6+
require 'custom.plugins.flash',
7+
require 'custom.plugins.autopairs',
8+
require 'custom.plugins.wilder',
9+
}

lua/custom/plugins/lazygit.lua

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

lua/custom/plugins/wilder.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
return {
2+
{
3+
'gelguy/wilder.nvim',
4+
keys = {
5+
':',
6+
'/',
7+
'?',
8+
},
9+
dependencies = {
10+
11+
'catppuccin/nvim',
12+
},
13+
config = function()
14+
local wilder = require 'wilder'
15+
local macchiato = require('catppuccin.palettes').get_palette 'macchiato'
16+
17+
-- Create a highlight group for the popup menu
18+
local text_highlight = wilder.make_hl('WilderText', { { a = 1 }, { a = 1 }, { foreground = macchiato.text } })
19+
local mauve_highlight = wilder.make_hl('WilderMauve', { { a = 1 }, { a = 1 }, { foreground = macchiato.mauve } })
20+
21+
-- Enable wilder when pressing :, / or ?
22+
wilder.setup { modes = { ':', '/', '?' } }
23+
24+
-- Enable fuzzy matching for commands and buffers
25+
-- wilder.set_option("pipeline", {
26+
-- wilder.branch(
27+
-- wilder.cmdline_pipeline({
28+
-- fuzzy = 1,
29+
-- }),
30+
-- wilder.vim_search_pipeline({
31+
-- fuzzy = 1,
32+
-- })
33+
-- ),
34+
-- })
35+
36+
wilder.set_option(
37+
'renderer',
38+
wilder.popupmenu_renderer(wilder.popupmenu_border_theme {
39+
highlighter = wilder.basic_highlighter(),
40+
highlights = {
41+
default = text_highlight,
42+
border = mauve_highlight,
43+
accent = mauve_highlight,
44+
},
45+
pumblend = 5,
46+
min_height = '25%',
47+
max_height = '25%',
48+
border = 'rounded',
49+
left = { ' ', wilder.popupmenu_devicons() },
50+
right = { ' ', wilder.popupmenu_scrollbar() },
51+
})
52+
)
53+
end,
54+
build = ':UpdateRemotePlugins',
55+
},
56+
}

lua/kickstart/plugins/neo-tree.lua

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,90 @@
1-
-- Neo-tree is a Neovim plugin to browse the file system
2-
-- https://github.com/nvim-neo-tree/neo-tree.nvim
3-
41
return {
52
'nvim-neo-tree/neo-tree.nvim',
63
version = '*',
74
dependencies = {
85
'nvim-lua/plenary.nvim',
9-
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
6+
'nvim-tree/nvim-web-devicons',
107
'MunifTanjim/nui.nvim',
118
},
129
cmd = 'Neotree',
10+
init = function()
11+
vim.api.nvim_create_autocmd('VimEnter', {
12+
pattern = '*',
13+
command = 'Neotree current',
14+
})
15+
end,
1316
keys = {
14-
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
17+
{ '<leader>e', ':Neotree toggle<CR>', { desc = 'NeoTree toggle' } },
1518
},
1619
opts = {
20+
event_handlers = {
21+
{
22+
event = 'neo_tree_buffer_enter',
23+
handler = function()
24+
vim.opt.relativenumber = true
25+
end,
26+
},
27+
{
28+
event = 'file_opened',
29+
handler = function()
30+
require('neo-tree.command').execute { action = 'close' }
31+
end,
32+
},
33+
},
1734
filesystem = {
35+
bind_to_cwd = false,
36+
follow_current_file = { enabled = true },
37+
use_libuv_file_watcher = true,
38+
hijack_netrw_behavior = 'open_current',
1839
window = {
1940
mappings = {
20-
['\\'] = 'close_window',
41+
['<space>'] = 'none',
42+
['<leader>E'] = 'close_window',
43+
['J'] = function(state)
44+
local tree = state.tree
45+
local node = tree:get_node()
46+
local siblings = tree:get_nodes(node:get_parent_id())
47+
local renderer = require 'neo-tree.ui.renderer'
48+
renderer.focus_node(state, siblings[#siblings]:get_id())
49+
end,
50+
['K'] = function(state)
51+
local tree = state.tree
52+
local node = tree:get_node()
53+
local siblings = tree:get_nodes(node:get_parent_id())
54+
local renderer = require 'neo-tree.ui.renderer'
55+
renderer.focus_node(state, siblings[1]:get_id())
56+
end,
57+
['l'] = 'open',
58+
['h'] = 'close_node',
2159
},
2260
},
61+
filtered_items = {
62+
hide_dotfiles = false,
63+
hide_gitignored = false,
64+
},
2365
},
2466
},
2567
}
68+
69+
-- return {
70+
-- 'nvim-neo-tree/neo-tree.nvim',
71+
-- version = '*',
72+
-- dependencies = {
73+
-- 'nvim-lua/plenary.nvim',
74+
-- 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
75+
-- 'MunifTanjim/nui.nvim',
76+
-- },
77+
-- cmd = 'Neotree',
78+
-- keys = {
79+
-- { '<leader>e', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
80+
-- },
81+
-- opts = {
82+
-- filesystem = {
83+
-- window = {
84+
-- mappings = {
85+
-- ['<leader>e'] = 'close_window',
86+
-- },
87+
-- },
88+
-- },
89+
-- },
90+
-- }

0 commit comments

Comments
 (0)