Skip to content

Commit 4b352af

Browse files
committed
Custom Changes
1 parent 4120893 commit 4b352af

File tree

1 file changed

+182
-5
lines changed

1 file changed

+182
-5
lines changed

init.lua

Lines changed: 182 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ vim.g.mapleader = ' '
9191
vim.g.maplocalleader = ' '
9292

9393
-- Set to true if you have a Nerd Font installed and selected in the terminal
94-
vim.g.have_nerd_font = false
94+
vim.g.have_nerd_font = true
9595

9696
-- [[ Setting options ]]
9797
-- See `:help vim.opt`
@@ -132,7 +132,7 @@ vim.opt.smartcase = true
132132
vim.opt.signcolumn = 'yes'
133133

134134
-- Decrease update time
135-
vim.opt.updatetime = 250
135+
vim.opt.updatetime = 200
136136

137137
-- Decrease mapped sequence wait time
138138
-- Displays which-key popup sooner
@@ -155,7 +155,7 @@ vim.opt.inccommand = 'split'
155155
vim.opt.cursorline = true
156156

157157
-- Minimal number of screen lines to keep above and below the cursor.
158-
vim.opt.scrolloff = 10
158+
vim.opt.scrolloff = 20
159159

160160
-- [[ Basic Keymaps ]]
161161
-- See `:help vim.keymap.set()`
@@ -190,6 +190,83 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
190190
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
191191
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
192192

193+
-- Setup the statusline
194+
-- Statusline configuration with rounded corners
195+
local function get_custom_statusline()
196+
-- Helper function to create rounded separators
197+
local function round_separator(color1, color2)
198+
return '%#' .. color1 .. '#' .. '' .. '%#' .. color2 .. '#'
199+
end
200+
201+
-- Define colors
202+
vim.cmd [[
203+
hi StatusLineAccent guibg=#1a1b26 guifg=#7aa2f7
204+
hi StatusLineInsert guibg=#1a1b26 guifg=#9ece6a
205+
hi StatusLineNormal guibg=#1a1b26 guifg=#7aa2f7
206+
hi StatusLineVisual guibg=#1a1b26 guifg=#bb9af7
207+
hi StatusLinePath guibg=#1a1b26 guifg=#737aa2
208+
hi StatusLineModified guibg=#1a1b26 guifg=#e0af68
209+
]]
210+
211+
-- Get current mode
212+
local mode_colors = {
213+
n = 'StatusLineNormal',
214+
i = 'StatusLineInsert',
215+
v = 'StatusLineVisual',
216+
V = 'StatusLineVisual',
217+
[''] = 'StatusLineVisual',
218+
}
219+
220+
local current_mode = vim.api.nvim_get_mode().mode
221+
local mode_color = mode_colors[current_mode] or 'StatusLineNormal'
222+
223+
-- Build statusline components
224+
local components = {
225+
-- Left side
226+
'%#'
227+
.. mode_color
228+
.. '#',
229+
' ',
230+
vim.fn.mode(),
231+
' ',
232+
round_separator(mode_color, 'StatusLinePath'),
233+
' %f', -- Filename
234+
' %m', -- Modified flag
235+
236+
-- Right side alignment
237+
'%=',
238+
'%#StatusLineAccent#',
239+
' %l:%c ', -- Line and column
240+
round_separator('StatusLineAccent', 'StatusLineNormal'),
241+
' %p%% ', -- Percentage through file
242+
}
243+
244+
return table.concat(components)
245+
end
246+
247+
-- Set the statusline
248+
vim.opt.statusline = '%!v:lua.get_custom_statusline()'
249+
250+
-- Make sure the statusline is always visible
251+
vim.opt.laststatus = 2
252+
253+
-- Remove the mode display since it's in the statusline
254+
vim.opt.showmode = false
255+
256+
-- Optional: customize colors based on your colorscheme
257+
-- Replace these colors with ones that match your theme
258+
vim.cmd [[
259+
augroup CustomStatusline
260+
autocmd!
261+
autocmd ColorScheme * hi StatusLineAccent guibg=#1a1b26 guifg=#7aa2f7
262+
autocmd ColorScheme * hi StatusLineInsert guibg=#1a1b26 guifg=#9ece6a
263+
autocmd ColorScheme * hi StatusLineNormal guibg=#1a1b26 guifg=#7aa2f7
264+
autocmd ColorScheme * hi StatusLineVisual guibg=#1a1b26 guifg=#bb9af7
265+
autocmd ColorScheme * hi StatusLinePath guibg=#1a1b26 guifg=#737aa2
266+
autocmd ColorScheme * hi StatusLineModified guibg=#1a1b26 guifg=#e0af68
267+
augroup END
268+
]]
269+
193270
-- [[ Basic Autocommands ]]
194271
-- See `:help lua-guide-autocommands`
195272

@@ -243,7 +320,7 @@ require('lazy').setup({
243320
-- require('gitsigns').setup({ ... })
244321
--
245322
-- See `:help gitsigns` to understand what the configuration keys do
246-
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
323+
{
247324
'lewis6991/gitsigns.nvim',
248325
opts = {
249326
signs = {
@@ -253,6 +330,15 @@ require('lazy').setup({
253330
topdelete = { text = '' },
254331
changedelete = { text = '~' },
255332
},
333+
-- Add blame configuration
334+
current_line_blame = true, -- Toggle current line blame
335+
current_line_blame_opts = {
336+
virt_text = true,
337+
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
338+
delay = 250, -- Delay in milliseconds before blame is shown
339+
ignore_whitespace = false,
340+
},
341+
current_line_blame_formatter = ' | <author>, <author_time:%Y-%m-%d> - <summary>',
256342
},
257343
},
258344

@@ -324,6 +410,50 @@ require('lazy').setup({
324410
},
325411
},
326412
},
413+
-- Github Copilot --
414+
{
415+
'github/copilot.vim',
416+
event = 'VimEnter',
417+
},
418+
419+
-- Add this to your plugins table in the lazy.nvim setup:
420+
{
421+
'nvim-neo-tree/neo-tree.nvim',
422+
branch = 'v3.x',
423+
dependencies = {
424+
'nvim-lua/plenary.nvim',
425+
'nvim-tree/nvim-web-devicons', -- optional, for file icons
426+
'MunifTanjim/nui.nvim',
427+
},
428+
config = function()
429+
require('neo-tree').setup {
430+
close_if_last_window = false,
431+
enable_git_status = true,
432+
enable_diagnostics = true,
433+
filesystem = {
434+
filtered_items = {
435+
visible = false,
436+
hide_dotfiles = false,
437+
hide_gitignored = false,
438+
},
439+
follow_current_file = {
440+
enabled = true, -- This will find and focus the file in the active buffer every time
441+
leave_dirs_open = true, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
442+
},
443+
},
444+
window = {
445+
width = 30,
446+
mappings = {
447+
['<space>'] = 'none',
448+
},
449+
},
450+
}
451+
452+
-- Keymaps
453+
vim.keymap.set('n', '<leader>e', ':Neotree toggle<CR>', { desc = 'Toggle [E]xplorer' })
454+
vim.keymap.set('n', '<leader>o', ':Neotree focus<CR>', { desc = 'F[o]cus Explorer' })
455+
end,
456+
},
327457

328458
-- NOTE: Plugins can specify dependencies.
329459
--
@@ -606,7 +736,21 @@ require('lazy').setup({
606736
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
607737
local servers = {
608738
-- clangd = {},
609-
-- gopls = {},
739+
gopls = {
740+
settings = {
741+
gopls = {
742+
analyses = {
743+
unusedparams = true,
744+
shadow = true,
745+
},
746+
staticcheck = true,
747+
gofumpt = true,
748+
usePlaceholders = true,
749+
completeUnimported = true,
750+
importShortcut = 'Both',
751+
},
752+
},
753+
},
610754
-- pyright = {},
611755
-- rust_analyzer = {},
612756
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
@@ -665,6 +809,39 @@ require('lazy').setup({
665809
end,
666810
},
667811

812+
{
813+
'ThePrimeagen/refactoring.nvim',
814+
dependencies = {
815+
'nvim-lua/plenary.nvim',
816+
'nvim-treesitter/nvim-treesitter',
817+
},
818+
config = function()
819+
require('refactoring').setup()
820+
end,
821+
},
822+
{
823+
'ray-x/go.nvim',
824+
dependencies = {
825+
'ray-x/guihua.lua',
826+
'neovim/nvim-lspconfig',
827+
'nvim-treesitter/nvim-treesitter',
828+
},
829+
config = function()
830+
require('go').setup {
831+
-- Add your go.nvim configuration here
832+
lsp_gofumpt = true,
833+
lsp_on_attach = true,
834+
gopls_cmd = { 'gopls' },
835+
fillstruct = 'gopls',
836+
dap_debug = true,
837+
dap_debug_gui = true,
838+
}
839+
end,
840+
event = { 'CmdlineEnter' },
841+
ft = { 'go', 'gomod' },
842+
build = ':lua require("go.install").update_all_sync()',
843+
},
844+
668845
{ -- Autoformat
669846
'stevearc/conform.nvim',
670847
event = { 'BufWritePre' },

0 commit comments

Comments
 (0)