diff options
| author | bh <qn+git@excalibur.computer> | 2025-11-13 19:55:39 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2025-11-13 19:55:39 +0800 |
| commit | 1afa56764aaddbbc4253c8e61086aedec2340efd (patch) | |
| tree | c66c56f2b66f77031566904e9f93e648b17e61bb /init.lua | |
| parent | cfaa4eb06d8353288aa19238c6519a29a9df5d75 (diff) | |
LuaSnips Stuff
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -71,6 +71,28 @@ vim.g.mapleader = ' ' -- Tree vim.api.nvim_set_keymap('n', '<leader>t', ':NvimTreeToggle<CR>', { noremap = true, silent = true }) +-- vim.keymap.set('n', '<Space>;', function() +-- -- Append a semicolon at the end of the line without moving the cursor +-- local col = vim.fn.col('.') -- save current column +-- vim.cmd('normal! A;') -- go to end of line and append ; +-- vim.fn.cursor(vim.fn.line('.'), col) -- restore cursor +-- end, { noremap = true, silent = true }) + +-- ~/.config/nvim/lua/keymaps.lua +vim.keymap.set('n', '<Space>;', function() + local row, col = unpack(vim.api.nvim_win_get_cursor(0)) -- save cursor + local line = vim.api.nvim_get_current_line() + + -- Only add semicolon if it doesn't exist + if not line:match(";$") then + vim.api.nvim_set_current_line(line .. ";") + end + + -- Restore cursor + vim.api.nvim_win_set_cursor(0, {row, col}) +end, { noremap = true, silent = true }) + + -- Telescope local builtin = require('telescope.builtin') vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) @@ -79,6 +101,7 @@ vim.keymap.set('n', '<leader>fb', builtin.buffers, {}) + -------------------------------------------------------- -- 🪶 GUI and Colour Configuration -------------------------------------------------------- @@ -129,6 +152,9 @@ vim.cmd [[ highlight BufferCurrentIcon guifg=#8affff guibg=#003636 highlight BufferTabpageFill guibg=#003636 + + highlight Folded guifg=#74c4c4 guibg=#003636 + highlight FoldColumn guifg=#74c4c4 guibg=#003636 ]] -- desired icon background colour |
