Skip to content

Commit 7851cfe

Browse files
Done
1 parent d350db2 commit 7851cfe

File tree

7 files changed

+129
-12
lines changed

7 files changed

+129
-12
lines changed

init.lua

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
102102
vim.opt.number = true
103103
-- You can also add relative line numbers, to help with jumping.
104104
-- Experiment for yourself to see if you like it!
105-
-- vim.opt.relativenumber = true
105+
vim.opt.relativenumber = true
106106

107107
-- Enable mouse mode, can be useful for resizing splits for example!
108108
vim.opt.mouse = 'a'
@@ -166,7 +166,9 @@ vim.opt.confirm = true
166166

167167
-- Clear highlights on search when pressing <Esc> in normal mode
168168
-- See `:help hlsearch`
169-
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
169+
-- vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
170+
-- Replaced with a better approach that doesn't override Escape's normal function
171+
vim.keymap.set('n', '<leader>/', '<cmd>nohlsearch<CR>', { desc = 'Clear search highlights' })
170172

171173
-- Diagnostic keymaps
172174
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
@@ -177,7 +179,7 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
177179
--
178180
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
179181
-- or just use <C-\><C-n> to exit terminal mode
180-
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
182+
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
181183

182184
-- TIP: Disable arrow keys in normal mode
183185
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
@@ -965,18 +967,18 @@ require('lazy').setup({
965967
-- Here are some example plugins that I've included in the Kickstart repository.
966968
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
967969
--
968-
-- 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
970+
require 'kickstart.plugins.debug',
971+
require 'kickstart.plugins.indent_line',
972+
require 'kickstart.plugins.lint',
973+
require 'kickstart.plugins.autopairs',
974+
require 'kickstart.plugins.neo-tree',
975+
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
974976

975977
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
976978
-- This is the easiest way to modularize your config.
977979
--
978980
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
979-
-- { import = 'custom.plugins' },
981+
{ import = 'custom.plugins' },
980982
--
981983
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
982984
-- Or use telescope!

kickstart.nvim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit d350db2449da40df003c40d440f909d74e2d4e70

lua/custom/plugins/copilot.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
-- GitHub Copilot configuration
2+
-- https://github.com/github/copilot.vim
3+
4+
return {
5+
"github/copilot.vim",
6+
event = "InsertEnter",
7+
config = function()
8+
-- Disable default mappings
9+
vim.g.copilot_no_maps = true
10+
11+
-- Key mappings
12+
vim.keymap.set('i', '<C-j>', 'copilot#Accept("<CR>")', {
13+
expr = true,
14+
replace_keycodes = false,
15+
silent = true,
16+
})
17+
18+
-- Additional keymaps for Copilot
19+
vim.keymap.set('i', '<C-l>', '<Plug>(copilot-accept-word)', { silent = true })
20+
vim.keymap.set('i', '<C-]>', '<Plug>(copilot-next)', { silent = true })
21+
-- Changed from <C-[> to <M-[> (Alt+[) to avoid conflicting with Escape
22+
vim.keymap.set('i', '<M-[>', '<Plug>(copilot-previous)', { silent = true })
23+
vim.keymap.set('i', '<C-\\>', '<Plug>(copilot-dismiss)', { silent = true })
24+
25+
-- Additional settings
26+
vim.g.copilot_filetypes = {
27+
["*"] = true,
28+
["markdown"] = true,
29+
["help"] = false,
30+
}
31+
end,
32+
}

lua/custom/plugins/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
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+
-- Load all plugin files in the custom/plugins directory
7+
}

lua/custom/plugins/tab_keymaps.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- Tab management keymaps
2+
-- These provide VS Code-like tab navigation and management
3+
4+
-- Create a new empty tab
5+
vim.keymap.set('n', '<leader>tn', ':tabnew<CR>', { desc = 'New tab' })
6+
7+
-- Create a new tab and open Telescope file finder
8+
vim.keymap.set('n', '<leader>to', ':tabnew<CR>:Telescope find_files<CR>', { desc = 'New tab with file' })
9+
10+
-- Close the current tab
11+
vim.keymap.set('n', '<leader>tc', ':tabclose<CR>', { desc = 'Close tab' })
12+
13+
-- Navigate to next tab (similar to VS Code)
14+
vim.keymap.set('n', '<C-PgDn>', 'gt', { desc = 'Next tab' })
15+
16+
-- Navigate to previous tab (similar to VS Code)
17+
vim.keymap.set('n', '<C-PgUp>', 'gT', { desc = 'Previous tab' })
18+
19+
-- Add this keymap group to Which-key if you're using it
20+
-- (the plugin will automatically pick this up on next restart)
21+
return {}

lua/custom/plugins/toggleterm.lua

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
-- toggleterm.lua
2+
-- A plugin that helps manage multiple terminal windows in Neovim
3+
-- Github: https://github.com/akinsho/toggleterm.nvim
4+
5+
return {
6+
-- The repository on GitHub
7+
'akinsho/toggleterm.nvim',
8+
9+
-- Use the latest stable version
10+
version = "*",
11+
12+
-- Configuration options for the plugin
13+
opts = {
14+
-- Ctrl+\ will toggle the terminal visibility
15+
open_mapping = [[<c-\>]],
16+
17+
-- Terminal appears as a floating window by default
18+
direction = 'float',
19+
20+
-- How the floating window should look
21+
float_opts = {
22+
-- Curved borders for a nicer appearance
23+
border = 'curved',
24+
},
25+
26+
-- Slightly dim the terminal background
27+
shade_terminals = true,
28+
29+
-- How much to dim the terminal (0-100)
30+
shading_factor = 2,
31+
32+
-- Function to determine size based on terminal direction
33+
size = function(term)
34+
if term.direction == "horizontal" then
35+
-- 15 lines height for horizontal terminals
36+
return 15
37+
elseif term.direction == "vertical" then
38+
-- 40% of window width for vertical terminals
39+
return vim.o.columns * 0.4
40+
end
41+
end,
42+
},
43+
44+
-- Extra key mappings for different terminal layouts
45+
keys = {
46+
-- Leader+th opens a horizontal terminal at the bottom
47+
{ "<leader>th", "<cmd>ToggleTerm direction=horizontal<cr>", desc = "Terminal Horizontal" },
48+
49+
-- Leader+tv opens a vertical terminal at the side
50+
{ "<leader>tv", "<cmd>ToggleTerm direction=vertical<cr>", desc = "Terminal Vertical" },
51+
52+
-- Leader+tf opens a floating terminal (alternative to Ctrl+\)
53+
{ "<leader>tf", "<cmd>ToggleTerm direction=float<cr>", desc = "Terminal Float" },
54+
55+
-- Leader+tt opens a new terminal tab
56+
{ "<leader>tt", "<cmd>ToggleTerm direction=tab<cr>", desc = "Terminal Tab" },
57+
},
58+
}

lua/kickstart/plugins/lint.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ return {
66
config = function()
77
local lint = require 'lint'
88
lint.linters_by_ft = {
9-
markdown = { 'markdownlint' },
9+
-- Commenting out markdownlint to prevent errors
10+
-- markdown = { 'markdownlint' },
1011
}
1112

1213
-- To allow other plugins to add linters to require('lint').linters_by_ft,

0 commit comments

Comments
 (0)