Set git ignore and add functions

This commit is contained in:
Raoul Branten 2025-01-27 15:59:02 +01:00
parent 6def6cb5dd
commit c52fb36c51
3 changed files with 19 additions and 0 deletions

View File

@ -1,4 +1,5 @@
require("core.options")
require("core.functions")
require("core.keymaps")
require("core.plugins")
require("core.aliases")

17
lua/core/functions.lua Normal file
View File

@ -0,0 +1,17 @@
-- add debug print backtrace on cursor
-- function backtrace()
-- local pos = vim.api.nvim_win_get_cursor(0)[2]
-- local line = vim.api.nvim_get_current_line()
-- local nline = line:sub(0, pos) .. 'debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)' .. line:sub(pos + 1)
-- vim.api.nvim_set_current_line(nline)
-- end
--vim.api.nvim_create_user_command('backtrace', 'echo "debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)"', {'bang': v:true})
--
local PHP = {}
PHP.backtrace = function()
local pos = vim.api.nvim_win_get_cursor(0)[2]
local line = vim.api.nvim_get_current_line()
local nline = line:sub(0, pos) .. 'debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)' .. line:sub(pos + 1)
vim.api.nvim_set_current_line(nline)
end

View File

@ -4,3 +4,4 @@ vim.g.loaded_netrwPlugin = 1
require("nvim-tree").setup()
vim.keymap.set('n', '<c-n>', ':NvimTreeFindFileToggle<CR>')
--vim.keymap.set("n", "I", nvim-tree-api.tree.toggle_gitignore_filter(), opts("Toggle Git Ignore"))