Skip to content

Commit 87e5876

Browse files
committed
feat: update fish; add lazygit
1 parent a0dc27e commit 87e5876

File tree

4 files changed

+60
-67
lines changed

4 files changed

+60
-67
lines changed

home-manager/mac/home.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
convco
4242
gh
4343
eza
44+
lazygit
4445
];
4546

4647
programs.alacritty = {
@@ -109,6 +110,15 @@
109110
# eval "$(/opt/homebrew/bin/brew shellenv)"
110111
tmux source-file ~/.config/tmux/tmux.conf
111112
'';
113+
# plugins = [{
114+
# name = "foreign-env";
115+
# src = pkgs.fetchFromGitHub {
116+
# owner = "oh-my-fish";
117+
# repo = "plugin-foreign-env";
118+
# rev = "7f0cf099ae1e1e4ab38f46350ed6757d54471de7";
119+
# sha256 = "sha256-4+k5rSoxkTtYFh/lEjhRkVYa2S4KEzJ/IJbyJl+rJjQ=";
120+
# };
121+
# }];
112122
};
113123

114124
xdg.configFile.yabai = {

hosts/mac/configuration.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
upgrade = true;
4545
cleanup = "zap";
4646
};
47+
brews = [
48+
];
49+
casks = [
50+
"docker"
51+
];
4752
};
4853

4954
# Global system settings

modules/init.lua

Lines changed: 25 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ local function tmap(shortcut, command)
1818
map('t', shortcut, command)
1919
end
2020

21+
-- Define the function as global
22+
function hover_and_diagnostics()
23+
-- Check for diagnostics at the current cursor position
24+
local diagnostics = vim.diagnostic.get(0, { lnum = vim.fn.line('.') - 1 })
25+
26+
if #diagnostics > 0 then
27+
-- Show diagnostics if any exist
28+
vim.diagnostic.open_float(nil, { focus = false, border = "rounded" })
29+
else
30+
-- Otherwise, show hover information
31+
vim.lsp.buf.hover()
32+
end
33+
end
34+
2135
vim.opt.updatetime = 100
2236
-- disable netrw at the very start of your init.lua (strongly advised)
2337
vim.g.loaded_netrw = 1
@@ -96,7 +110,8 @@ nmap("<leader>c", ":Bdelete<cr>")
96110
vmap(">", ">gv")
97111
vmap("<", "<gv")
98112
tmap("<Esc>", "<C-\\><C-n>")
99-
113+
-- Map 'K' to hover_and_diagnostics
114+
-- vim.api.nvim_set_keymap('n', 'K', ':lua hover_and_diagnostics()<CR>', { noremap = true, silent = true })
100115

101116
require("neo-tree").setup({
102117
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
@@ -121,22 +136,6 @@ require("neo-tree").setup({
121136
}
122137
})
123138

124-
local wilder = require('wilder')
125-
wilder.setup({
126-
modes = { ':', '/', '?' },
127-
})
128-
wilder.set_option('renderer', wilder.popupmenu_renderer(
129-
wilder.popupmenu_border_theme({
130-
highlighter = wilder.basic_highlighter(),
131-
highlights = {
132-
accent = wilder.make_hl('WilderAccent', 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = '#f4468f' } }),
133-
},
134-
border = 'rounded',
135-
left = { ' ', wilder.popupmenu_devicons() },
136-
right = { ' ', wilder.popupmenu_scrollbar() },
137-
})
138-
))
139-
140139
require('dashboard').setup({
141140
config = {
142141
week_header = {
@@ -146,28 +145,16 @@ require('dashboard').setup({
146145
})
147146

148147
require('lspconfig').hls.setup {
149-
cmd = (vim.fn.executable('haskell-language-server-wrapper') == 1 and { 'haskell-language-server-wrapper', '--lsp' })
148+
cmd =
149+
(vim.fn.executable('haskell-language-server-wrapper') == 1 and { 'haskell-language-server-wrapper', '--lsp' })
150150
or (vim.fn.executable('haskell-language-server') == 1 and { 'haskell-language-server', '--lsp' })
151151
or nil,
152152
}
153153

154-
-- require("noice").setup({
155-
-- routes = {
156-
-- {
157-
-- view = "notify",
158-
-- filter = { event = "msg_showmode" },
159-
-- },
160-
-- },
161-
-- })
162-
163-
-- require("lualine").setup({
164-
-- sections = {
165-
-- lualine_x = {
166-
-- {
167-
-- require("noice").api.statusline.mode.get,
168-
-- cond = require("noice").api.statusline.mode.has,
169-
-- color = { fg = "#ff9e64" },
170-
-- }
171-
-- },
172-
-- },
173-
-- })
154+
vim.api.nvim_create_autocmd('TextYankPost', {
155+
desc = 'Highlight when yanking (copying) text',
156+
group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
157+
callback = function()
158+
vim.highlight.on_yank()
159+
end,
160+
})

modules/nixvim.nix

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,10 @@ in
4040
# UI Enhancements
4141
# Add file type icons to various plugins
4242
web-devicons.enable = true;
43+
colorizer.enable = true;
4344
# Lightweight and customizable status line
4445
lualine = {
4546
enable = true;
46-
# luaConfig.pre = ''
47-
# require("lualine").setup({
48-
# sections = {
49-
# lualine_x = {
50-
# 'encoding', 'fileformat', 'filetype',
51-
# {
52-
# require("noice").api.statusline.mode.get,
53-
# cond = function()
54-
# local noice = require("noice")
55-
# if noice.api.statusline.mode.has() then
56-
# return noice.api.statusline.mode.get():lower():find("recording") ~= nil
57-
# end
58-
# return false
59-
# end,
60-
# color = { fg = "#ff9e64" },
61-
# }
62-
# },
63-
# },
64-
# })
65-
# '';
6647
};
6748
# Seamless navigation between tmux and vim panes
6849
tmux-navigator.enable = true;
@@ -87,15 +68,22 @@ in
8768
# Display key binding hints and help
8869
which-key.enable = true;
8970
# Enhanced command-line completion
90-
# noice = {
91-
# enable = true;
92-
# settings = {
93-
# presets = {
94-
# lsp_doc_border = true;
95-
# };
96-
# };
97-
# };
98-
wilder.enable = true;
71+
noice = {
72+
enable = true;
73+
settings = {
74+
presets = {
75+
lsp_doc_border = true;
76+
};
77+
routes = [{
78+
view = "notify";
79+
filter = {
80+
event = "msg_showmode";
81+
find = "recording";
82+
};
83+
}];
84+
};
85+
};
86+
wilder.enable = false;
9987
# Powerful fuzzy finder and picker
10088
telescope.enable = true;
10189
# Improve the look of vim's native UI elements
@@ -159,7 +147,10 @@ in
159147
};
160148
# TypeScript language server
161149
ts_ls.enable = true;
150+
jsonls.enable = true;
162151
tinymist.enable = true;
152+
dockerls.enable = true;
153+
docker_compose_language_service.enable = true;
163154
};
164155
};
165156
# Add icons to completion menu

0 commit comments

Comments
 (0)