Skip to content

Commit 67dcdf7

Browse files
committed
window setup customization
1 parent 0619d89 commit 67dcdf7

3 files changed

Lines changed: 114 additions & 6 deletions

File tree

init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ require('lazy').setup({
700700
-- python = { "isort", "black" },
701701
--
702702
-- You can use 'stop_after_first' to run the first available formatter from the list
703-
-- javascript = { "prettierd", "prettier", stop_after_first = true },
703+
javascript = { 'prettierd', 'prettier', stop_after_first = true },
704704
},
705705
},
706706
},
@@ -914,13 +914,13 @@ require('lazy').setup({
914914
-- require 'kickstart.plugins.lint',
915915
-- require 'kickstart.plugins.autopairs',
916916
-- require 'kickstart.plugins.neo-tree',
917-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
917+
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
918918

919919
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
920920
-- This is the easiest way to modularize your config.
921921
--
922922
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
923-
-- { import = 'custom.plugins' },
923+
{ import = 'custom.plugins' },
924924
--
925925
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
926926
-- Or use telescope!
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
return {
2+
'h3pei/copy-file-path.nvim',
3+
}

lua/custom/plugins/init.lua

Lines changed: 108 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,111 @@
33
--
44
-- See the kickstart.nvim README for more information
55

6-
---@module 'lazy'
7-
---@type LazySpec
8-
return {}
6+
vim.keymap.set('n', 'x', '"_x') -- Delete without yanking
7+
vim.keymap.set('n', '<leader>pv', ':Ex<CR>') -- Open file explorer
8+
9+
-- Windows specific stuff:
10+
vim.keymap.set('n', '½', '$') -- Move to end of line in normal mode
11+
vim.keymap.set('v', '½', '$') -- Move to end of line in visual mode
12+
vim.keymap.set('o', '½', '$') -- operator-pending mode to end of line
13+
14+
vim.o.updatetime = 250
15+
vim.wo.signcolumn = 'yes'
16+
vim.opt.nu = true
17+
vim.opt.relativenumber = true
18+
vim.opt.tabstop = 2
19+
vim.opt.softtabstop = 2
20+
vim.opt.shiftwidth = 2
21+
vim.opt.expandtab = true
22+
vim.opt.incsearch = true
23+
vim.opt.hlsearch = false
24+
vim.opt.ignorecase = true
25+
vim.opt.smartcase = true
26+
vim.opt.backup = false
27+
vim.opt.writebackup = false
28+
vim.opt.cmdheight = 1
29+
vim.opt.scrolloff = 8
30+
vim.opt.signcolumn = 'yes'
31+
vim.opt.colorcolumn = '120'
32+
vim.opt.cursorline = true
33+
vim.opt.autoindent = true
34+
vim.opt.termguicolors = true
35+
vim.opt.winblend = 0
36+
vim.opt.wildoptions = 'pum'
37+
vim.opt.pumblend = 5
38+
vim.opt.background = 'dark'
39+
vim.opt.wrap = false
40+
vim.opt.clipboard = 'unnamedplus'
41+
42+
vim.g.vimwiki_list = {
43+
{ path = '~/Jottacloud/vimwiki' },
44+
}
45+
46+
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
47+
vim.keymap.set('i', '<C-J>', 'copilot#Accept("\\<CR>")', {
48+
expr = true,
49+
replace_keycodes = false,
50+
})
51+
-- #vim.g.copilot_no_tab_map = true
52+
--
53+
54+
-- Windows specific stuff:
55+
if vim.fn.has 'wsl' == 1 then
56+
vim.g.clipboard = {
57+
name = 'WslClipboard',
58+
copy = {
59+
['+'] = 'clip.exe',
60+
['*'] = 'clip.exe',
61+
},
62+
paste = {
63+
['+'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw))',
64+
['*'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw))',
65+
},
66+
cache_enabled = 0,
67+
}
68+
end
69+
70+
return {
71+
'vimwiki/vimwiki',
72+
'brenoprata10/nvim-highlight-colors', -- highlight colors in files
73+
'github/copilot.vim',
74+
75+
-- Configure Telescope to allow buffer deletion
76+
{
77+
'nvim-telescope/telescope.nvim',
78+
opts = function(_, opts)
79+
local actions = require 'telescope.actions'
80+
81+
-- Ensure pickers table exists
82+
opts.pickers = opts.pickers or {}
83+
84+
-- Configure buffers picker with deletion mapping
85+
-- Note: <C-x> conflicts with horizontal split, so we use <C-q> instead
86+
-- <C-d> conflicts with preview scroll down
87+
-- dd doesn't work because Telescope doesn't support multi-key sequences in normal mode
88+
opts.pickers.buffers = {
89+
mappings = {
90+
i = {
91+
['<C-q>'] = actions.delete_buffer, -- Recommended: no conflicts
92+
},
93+
n = {
94+
['d'] = actions.delete_buffer, -- Single 'd' key (simple and works)
95+
['<C-q>'] = actions.delete_buffer,
96+
},
97+
},
98+
}
99+
100+
return opts
101+
end,
102+
},
103+
{
104+
'stevearc/conform.nvim',
105+
opts = function(_, opts)
106+
opts.formatters_by_ft = opts.formatters_by_ft or {}
107+
opts.formatters_by_ft.typescript = { 'prettierd', 'prettier', stop_after_first = true }
108+
opts.formatters_by_ft.typescriptreact = { 'prettierd', 'prettier', stop_after_first = true }
109+
opts.formatters_by_ft.javascriptreact = { 'prettierd', 'prettier', stop_after_first = true }
110+
return opts
111+
end,
112+
},
113+
}

0 commit comments

Comments
 (0)