@@ -154,7 +154,7 @@ vim.opt.inccommand = 'split'
154154vim .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!
0 commit comments