Compare commits
2 commits
bd633d9101
...
2f1c1aa3c1
Author | SHA1 | Date | |
---|---|---|---|
|
2f1c1aa3c1 | ||
|
1271a2558b |
2 changed files with 20 additions and 16 deletions
|
@ -1,5 +1,10 @@
|
|||
-- [[ Setting autocmd's ]]
|
||||
-- See `:help autocmd`
|
||||
-- [[ Autocommands ]]
|
||||
-- See `:help autocmd`
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- These should be self-explanatory
|
||||
vim.api.nvim_create_user_command('Cd', 'cd %:h', { desc = 'Change directory to the current file' })
|
||||
vim.api.nvim_create_user_command('Py', 'python %', { desc = 'Execute python file' })
|
||||
|
||||
-- Instantly move help window to the right
|
||||
-- This is almost certainly a hacky way to do this)
|
||||
|
@ -7,3 +12,16 @@ vim.api.nvim_create_autocmd('FileType', {
|
|||
pattern = { 'help' },
|
||||
command = 'wincmd L',
|
||||
})
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
|
|
@ -57,18 +57,4 @@ vim.keymap.set('v', '<A-k>', '<cmd>MoveBlock(-1)<CR>')
|
|||
vim.keymap.set('v', '<A-h>', '<cmd>MoveHBlock(-1)<CR>')
|
||||
vim.keymap.set('v', '<A-l>', '<cmd>MoveHBlock(1)<CR>')
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
|
Loading…
Reference in a new issue