Skip to content

Commit

Permalink
feat: new ui
Browse files Browse the repository at this point in the history
  • Loading branch information
solidsnakedev committed Dec 14, 2024
1 parent 825dd6e commit 10f5d25
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 66 deletions.
51 changes: 20 additions & 31 deletions modules/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ vim.opt.list = true -- Show whitespace characters
vim.opt.listchars = { tab = '▸▸', trail = '·' }
vim.opt.signcolumn = "yes"

-- map c and d to black hole registers
map('n', 'd', '"_d')
map('n', 'c', '"_c')

-- Key mappings
imap('jk', '<Esc>') -- Escape using jk
imap('kj', '<Esc>') -- Escape using kj
Expand All @@ -69,7 +65,7 @@ map('n', '<S-Up>', 'yyddkP')
map('n', '<S-Down>', 'yyddp')
nmap('<Leader>h', ':nohl<cr>') -- Toggle highlight search

nmap("<leader>n", ":Neotree toggle<cr>")
nmap("<leader>n", ":Neotree toggle reveal<cr>")
nmap("<leader>gg", ":LazyGit<cr>")
nmap("<leader>ff", ":Telescope find_files<cr>")
nmap("<leader>fg", ":Telescope live_grep<cr>")
Expand All @@ -79,14 +75,9 @@ nmap("gd", ":Telescope lsp_definitions<cr>")
nmap("gr", ":Telescope lsp_reference<cr>")
nmap("gi", ":Telescope lsp_implementations<cr>")
nmap("<leader>ac", "<cmd>lua vim.lsp.buf.code_action()<cr>")
-- nmap("<leader>ac", ":Lspsaga code_action<cr>")
nmap("gp", "<cmd>lua vim.diagnostic.open_float()<cr>")
nmap("gk", "<cmd>lua vim.diagnostic.goto_prev()<cr>")
nmap("gj", "<cmd>lua vim.diagnostic.goto_next()<cr>")


-- nmap("<leader>gd", builtin.lsp_definitions)

nmap("s", ":HopChar1<cr>")
nmap("<S-L>", ":BufferLineCycleNext<cr>")
nmap("<S-H>", ":BufferLineCyclePrev<cr>")
Expand All @@ -96,6 +87,7 @@ require("neo-tree").setup({
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
window = {
position = "right",
auto_expand_width = true,
},
event_handlers = {
{
Expand All @@ -111,27 +103,24 @@ require("neo-tree").setup({
}
})

local wilder = require('wilder')
wilder.setup({
modes = { ':', '/', '?' },
accept_key = '<Right>',
reject_key = '<Left>',
})

wilder.set_option('renderer', wilder.popupmenu_renderer(
wilder.popupmenu_border_theme({
highlighter = wilder.basic_highlighter(),
highlights = {
border = 'Normal', -- highlight to use for the border
accent = wilder.make_hl('WilderAccent', 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = '#f4468f' } }),
},
-- 'single', 'double', 'rounded' or 'solid'
-- can also be a list of 8 characters, see :h wilder#popupmenu_border_theme() for more details
border = 'rounded',
left = { ' ', wilder.popupmenu_devicons() },
right = { ' ', wilder.popupmenu_scrollbar() },
})
))
-- local wilder = require('wilder')
-- wilder.setup({
-- modes = { ':', '/', '?' },
-- -- accept_key = '<Right>',
-- -- reject_key = '<Left>',
-- })
--
-- wilder.set_option('renderer', wilder.popupmenu_renderer(
-- wilder.popupmenu_border_theme({
-- highlighter = wilder.basic_highlighter(),
-- highlights = {
-- accent = wilder.make_hl('WilderAccent', 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = '#f4468f' } }),
-- },
-- border = 'rounded',
-- left = { ' ', wilder.popupmenu_devicons() },
-- right = { ' ', wilder.popupmenu_scrollbar() },
-- })
-- ))

require('dashboard').setup({
config = {
Expand Down
118 changes: 83 additions & 35 deletions modules/nixvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ in

# Color Scheme
# Use Catppuccin color scheme
colorschemes.catppuccin.enable = true;
colorschemes.catppuccin = {
enable = true;
settings = {
custom_highlights = ''
function(colors)
return {
LineNr = { fg = colors.overlay2, style = {} },
}
end
'';
};
};
plugins = {
# UI Enhancements
# Add file type icons to various plugins
Expand All @@ -30,19 +41,34 @@ in
# Seamless navigation between tmux and vim panes
tmux-navigator.enable = true;
# Improved syntax highlighting and parsing
treesitter.enable = true;
treesitter = {
enable = true;
settings = {
highlight.enable = true;
indent.enable = true;
incremental_selection.enable = true;
};
};
# Git integration using lazygit
lazygit.enable = true;
# Adds a buffer line with tab-like interface
bufferline.enable = true;
barbecue.enable = true;
# Automatically close brackets, parentheses, and quotes
nvim-autopairs.enable = true;
# Integrate with direnv for environment management
direnv.enable = true;
# Display key binding hints and help
which-key.enable = true;
# Enhanced command-line completion
wilder.enable = true;
noice = {
enable = true;
settings = {
presets = {
lsp_doc_border = true;
};
};
};
# Powerful fuzzy finder and picker
telescope.enable = true;
# Improve the look of vim's native UI elements
Expand All @@ -63,15 +89,11 @@ in
bufdelete.enable = true;
# Show LSP progress and status
fidget.enable = true;
notify.enable = true;
# Improved text wrapping
wrapping.enable = true;

# lsp
# rust-tools.enable = true;
# typescript-tools = {
# enable = true;
# settings.settings.exposeAsCodeAction = "all";
# };
# Automatically saves and restores session state
auto-session.enable = true;

# Language Server Protocol (LSP)
lsp = {
Expand Down Expand Up @@ -109,45 +131,51 @@ in
ts_ls.enable = true;
};
};
# Enhanced LSP UI with code actions and more
lspsaga = {
enable = true;
# Disable lightbulb code action indicator
lightbulb.enable = false;
};
# Add icons to completion menu
lspkind.enable = true;
# Automatic code formatting
lsp-format.enable = true;

# Snippets
# Snippet management plugin
nvim-snippets.enable = true;
# Collection of pre-made snippets
friendly-snippets.enable = true;
# Snippet engine with auto-snippet support
luasnip = {
# Code Formatting with conform-nvim
conform-nvim = {
enable = true;
settings = {
# Enable automatic snippet expansion
enable_autosnippets = true;
notify_on_error = true;
format_on_save = {
lspFallback = true;
timeoutMs = 500;
};
formatters_by_ft = {
javascript = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
stop_after_first = true;
};
typescript = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
stop_after_first = true;
};
typescriptreact = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
stop_after_first = true;
};
rust = [ "rustfmt" ];
};
};
};

# Autocompletion
# Use LSP as a completion source
cmp-nvim-lsp.enable = true;
# Add path completion
cmp-path.enable = true;
# Add buffer word completion
cmp-buffer.enable = true;
# Enable LuaSnip as a completion source
cmp_luasnip.enable = true;
# Completion engine configuration
# Autocompletion engine configuration
cmp = {
enable = true;
autoEnableSources = true;
settings = {
window =
{
completion.border = "rounded";
documentation.border = "rounded";
};
# Automatically enable completion sources
snippet.expand = ''
function(args)
Expand All @@ -161,6 +189,7 @@ in
{ name = "buffer"; }
{ name = "luasnip"; }
{ name = "snippets"; }
{ name = "friendly_snippets"; }
];
# Completion key mappings
mapping = {
Expand All @@ -180,6 +209,25 @@ in
};
};

# Snippets
# Snippet engine with auto-snippet support
luasnip = {
enable = true;
settings = {
# Enable automatic snippet expansion
enable_autosnippets = true;
};
};
# Snippet management plugin
nvim-snippets = {
enable = true;
settings = {
friendly-snippets = true;
};
};
# Pre-configured Snippet Collection
friendly-snippets.enable = true;

};
# Load additional Lua configuration from init.lua
extraConfigLua = builtins.readFile ./init.lua;
Expand Down

0 comments on commit 10f5d25

Please sign in to comment.