Snippets
This commit is contained in:
@@ -178,4 +178,13 @@ end, { desc = 'Close test panels' })
|
||||
-- "A command to properly indent json code
|
||||
-- command! FormatJSON %!python -m json.tool
|
||||
|
||||
-- Edit the snippet file for the current buffer filetype or the snippets
|
||||
-- directory if the file does not exist
|
||||
vim.keymap.set('n', '<Leader>es', function()
|
||||
local ft = vim.bo.filetype
|
||||
local snippets_dir = vim.fn.stdpath 'config' .. '/lua/snippets'
|
||||
local snippets_file = snippets_dir .. '/' .. ft .. '.json'
|
||||
vim.cmd('tabedit ' .. snippets_file)
|
||||
end, { desc = 'Edit snippets file' })
|
||||
|
||||
require('helpers').edit_cf('k', '/lua/keymap.lua')
|
||||
|
||||
Reference in New Issue
Block a user