mirror of
https://github.com/halfdan/dotfiles.git
synced 2025-09-10 19:56:24 +00:00
Setting up a lot of changes
This commit is contained in:
@@ -3,96 +3,120 @@ local lspkind = require('lspkind')
|
||||
local luasnip = require 'luasnip'
|
||||
|
||||
local source_mapping = {
|
||||
buffer = "[Buffer]",
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[Lua]",
|
||||
cmp_tabnine = "[TN]",
|
||||
path = "[Path]",
|
||||
buffer = "[Buffer]",
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[Lua]",
|
||||
cmp_tabnine = "[TN]",
|
||||
path = "[Path]",
|
||||
orgmode = "[Org]",
|
||||
luasnip = "[Snippet]",
|
||||
}
|
||||
|
||||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and
|
||||
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(
|
||||
col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
-- snippet = {
|
||||
-- -- REQUIRED - you must specify a snippet engine
|
||||
-- expand = function(args)
|
||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
-- -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
-- -- require'snippy'.expand_snippet(args.body) -- For `snippy` users.
|
||||
-- end,
|
||||
-- },
|
||||
--mapping = {
|
||||
--['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||
--['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||
--['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||
--['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
--},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require'luasnip'.lsp_expand(args.body)
|
||||
end,
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c' }),
|
||||
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false, -- only replace if explicitly selected
|
||||
},
|
||||
mapping = {
|
||||
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c' }),
|
||||
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false, -- only replace if explicitly selected
|
||||
},
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'cmp_tabnine' },
|
||||
{ name = 'nvim_lsp' },
|
||||
}),
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
vim_item.kind = lspkind.presets.default[vim_item.kind]
|
||||
local menu = source_mapping[entry.source.name]
|
||||
if entry.source.name == 'cmp_tabnine' then
|
||||
if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then
|
||||
menu = entry.completion_item.data.detail .. ' ' .. menu
|
||||
end
|
||||
vim_item.kind = '?'
|
||||
end
|
||||
vim_item.menu = menu
|
||||
return vim_item
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" })
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'cmp_tabnine' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
}),
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
vim_item.kind = lspkind.presets.default[vim_item.kind]
|
||||
local menu = source_mapping[entry.source.name]
|
||||
if entry.source.name == 'cmp_tabnine' then
|
||||
if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then
|
||||
menu = entry.completion_item.data.detail .. ' ' .. menu
|
||||
end
|
||||
}
|
||||
vim_item.kind = '?'
|
||||
end
|
||||
vim_item.menu = menu
|
||||
return vim_item
|
||||
end
|
||||
}
|
||||
})
|
||||
|
||||
-- Set configuration for specific filetype.
|
||||
cmp.setup.filetype('org', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'orgmode' },
|
||||
{ name = 'cmp_tabnine' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline('/', {
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
}),
|
||||
mappings = cmp.mapping.preset.cmdline(),
|
||||
mappings = cmp.mapping.preset.cmdline(),
|
||||
})
|
||||
|
||||
-- Setup tabnine
|
||||
local tabnine = require('cmp_tabnine.config')
|
||||
tabnine:setup({
|
||||
max_lines = 1000;
|
||||
max_num_results = 20;
|
||||
sort = true;
|
||||
run_on_every_keystroke = true;
|
||||
snippet_placeholder = '..';
|
||||
ignored_file_types = { -- default is not to ignore
|
||||
-- uncomment to ignore in lua:
|
||||
lua = true
|
||||
};
|
||||
max_lines = 1000;
|
||||
max_num_results = 20;
|
||||
sort = true;
|
||||
run_on_every_keystroke = true;
|
||||
snippet_placeholder = '..';
|
||||
ignored_file_types = { -- default is not to ignore
|
||||
-- uncomment to ignore in lua:
|
||||
lua = true
|
||||
};
|
||||
})
|
||||
|
||||
-- Setup lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
||||
|
25
.config/nvim/after/plugin/git-worktree.lua
Normal file
25
.config/nvim/after/plugin/git-worktree.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local Worktree = require("git-worktree")
|
||||
local Job = require("plenary.job")
|
||||
|
||||
local function is_massdriver()
|
||||
return not not (string.find(vim.loop.cwd(), "massdriver.git", 1, true))
|
||||
end
|
||||
|
||||
Worktree.on_tree_change(function (op, metadata)
|
||||
local compile_job = Job:new({
|
||||
"mix", "compile"
|
||||
})
|
||||
|
||||
if op == Worktree.Operations.Create and is_massdriver() then
|
||||
local deps_job = Job:new({
|
||||
"mix", "deps.get"
|
||||
})
|
||||
deps_job:and_then(compile_job)
|
||||
deps_job:sync()
|
||||
compile_job:wait()
|
||||
end
|
||||
|
||||
if op == Worktree.Operations.Switch and is_massdriver() then
|
||||
compile_job:start()
|
||||
end
|
||||
end)
|
@@ -47,6 +47,10 @@ vnoremap('>', '>gv')
|
||||
nnoremap('<TAB>', ':bnext<CR>')
|
||||
nnoremap('<S-TAB>', ':bprevious<CR>')
|
||||
|
||||
-- Quickfix list
|
||||
nnoremap('[q', ':cprev<CR>')
|
||||
nnoremap(']q', ':cnext<CR>')
|
||||
|
||||
-- Move selected line / block of text in visual mode
|
||||
xnoremap('J', ':move \'>+1<CR>gv-gv')
|
||||
xnoremap('K', ':move \'<-2<CR>gv-gv')
|
||||
|
@@ -2,37 +2,52 @@ local Remap = require("halfdan.keymap")
|
||||
local nnoremap = Remap.nnoremap
|
||||
local inoremap = Remap.inoremap
|
||||
|
||||
-- TODO figure out why this don't work
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignError",
|
||||
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignWarning",
|
||||
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignHint",
|
||||
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignInformation",
|
||||
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}
|
||||
)
|
||||
vim.fn.sign_define("DiagnosticSignError", {text = "", texthl = "DiagnosticSignError"})
|
||||
vim.fn.sign_define("DiagnosticSignWarn", {text = "", texthl = "DiagnosticSignWarn"})
|
||||
vim.fn.sign_define("DiagnosticSignInfo", {text = "", texthl = "DiagnosticSignInfo"})
|
||||
vim.fn.sign_define("DiagnosticSignHint", {text = "", texthl = "DiagnosticSignHint"})
|
||||
|
||||
-- Set Default Prefix.
|
||||
-- Note: You can set a prefix per lsp server in the lv-globals.lua file
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = {
|
||||
prefix = "",
|
||||
spacing = 1,
|
||||
},
|
||||
-- virtual_text = {
|
||||
-- prefix = "",
|
||||
-- spacing = 1,
|
||||
-- },
|
||||
signs = true,
|
||||
underline = true,
|
||||
}
|
||||
)
|
||||
|
||||
-- Setup for nvim-notify
|
||||
vim.lsp.set_log_level(1 )
|
||||
|
||||
local convert_lsp_log_level_to_neovim_log_level = function(lsp_log_level)
|
||||
if lsp_log_level == 1 then
|
||||
return 4
|
||||
elseif lsp_log_level == 2 then
|
||||
return 3
|
||||
elseif lsp_log_level == 3 then
|
||||
return 2
|
||||
elseif lsp_log_level == 4 then
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
local levels = {
|
||||
"ERROR",
|
||||
"WARN",
|
||||
"INFO",
|
||||
"DEBUG",
|
||||
[0] = "TRACE",
|
||||
}
|
||||
vim.lsp.handlers["window/showMessage"] = function(_, result, ...)
|
||||
if require("vim.lsp.log").should_log(convert_lsp_log_level_to_neovim_log_level(result.type)) then
|
||||
vim.notify(result.message, levels[result.type])
|
||||
end
|
||||
end
|
||||
|
||||
-- symbols for autocomplete
|
||||
vim.lsp.protocol.CompletionItemKind = {
|
||||
" (Text) ",
|
||||
@@ -81,12 +96,12 @@ local function documentHighlight(client, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
-- needed for the LSP to recognize elixir files (alternativly just use elixir-editors/vim-elixir)
|
||||
vim.cmd([[
|
||||
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
|
||||
au BufRead,BufNewFile *.eex,*.leex,*.sface set filetype=eelixir
|
||||
au BufRead,BufNewFile mix.lock set filetype=elixir
|
||||
]])
|
||||
-- -- needed for the LSP to recognize elixir files (alternativly just use elixir-editors/vim-elixir)
|
||||
-- vim.cmd([[
|
||||
-- au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
|
||||
-- au BufRead,BufNewFile *.eex,*.leex,*.sface set filetype=eelixir
|
||||
-- au BufRead,BufNewFile mix.lock set filetype=elixir
|
||||
-- ]])
|
||||
|
||||
|
||||
|
||||
@@ -95,47 +110,64 @@ vim.api.nvim_set_keymap('n', '<leader>e', '<cmd>lua vim.diagnostic.open_float()<
|
||||
vim.api.nvim_set_keymap('n', '<leader>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', { noremap = true, silent = true })
|
||||
|
||||
-- LSP settings
|
||||
local lsp_status = require('lsp-status')
|
||||
lsp_status.register_progress()
|
||||
|
||||
local lspconfig = require 'lspconfig'
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
nnoremap("gd", function() vim.lsp.buf.definition() end)
|
||||
nnoremap("gD", function() vim.lsp.buf.declaration() end)
|
||||
nnoremap("K", function() vim.lsp.buf.hover() end)
|
||||
nnoremap("gW", function() vim.lsp.buf.workspace_symbol() end)
|
||||
nnoremap("<leader>vd", function() vim.diagnostic.open_float() end)
|
||||
nnoremap("[d", function() vim.diagnostic.goto_next() end)
|
||||
nnoremap("]d", function() vim.diagnostic.goto_prev() end)
|
||||
nnoremap("<leader>ca", function() vim.lsp.buf.code_action() end)
|
||||
nnoremap("gr", function() vim.lsp.buf.references() end)
|
||||
nnoremap("<leader>rn", function() vim.lsp.buf.rename() end)
|
||||
nnoremap("<leader>cl", function() vim.lsp.codelens.run() end)
|
||||
nnoremap("<leader>ff", function() vim.lsp.buf.format{async = true} end)
|
||||
inoremap("<C-h>", function() vim.lsp.buf.signature_help() end)
|
||||
|
||||
lsp_status.on_attach(client, bufnr)
|
||||
end
|
||||
|
||||
local function config(_config)
|
||||
return vim.tbl_deep_extend("force", {
|
||||
capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()),
|
||||
on_attach = function()
|
||||
-- local opts = { noremap = true, silent = true }
|
||||
nnoremap("gd", function() vim.lsp.buf.definition() end)
|
||||
nnoremap("gD", function() vim.lsp.buf.declaration() end)
|
||||
nnoremap("K", function() vim.lsp.buf.hover() end)
|
||||
nnoremap("gW", function() vim.lsp.buf.workspace_symbol() end)
|
||||
nnoremap("<leader>vd", function() vim.diagnostic.open_float() end)
|
||||
nnoremap("[d", function() vim.diagnostic.goto_next() end)
|
||||
nnoremap("]d", function() vim.diagnostic.goto_prev() end)
|
||||
nnoremap("<leader>ca", function() vim.lsp.buf.code_action() end)
|
||||
nnoremap("<leader>rr", function() vim.lsp.buf.references() end)
|
||||
nnoremap("<leader>rn", function() vim.lsp.buf.rename() end)
|
||||
nnoremap("<leader>cl", function() vim.lsp.codelens.run() end)
|
||||
nnoremap("<leader>ff", function() vim.lsp.buf.format{async = true} end)
|
||||
inoremap("<C-h>", function() vim.lsp.buf.signature_help() end)
|
||||
--vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>so', [[<cmd>lua require('telescope.builtin').lsp_document_symbols()<CR>]], opts)
|
||||
-- vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]
|
||||
end,
|
||||
}, _config or {})
|
||||
_config = vim.tbl_deep_extend("force", {
|
||||
log_level = vim.lsp.protocol.MessageType.Log,
|
||||
message_level = vim.lsp.protocol.MessageType.Log,
|
||||
capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()),
|
||||
on_attach = on_attach,
|
||||
}, _config or {})
|
||||
|
||||
-- Set default client capabilities plus window/workDoneProgress
|
||||
_config.capabilities = vim.tbl_extend('keep', _config.capabilities or {}, lsp_status.capabilities)
|
||||
|
||||
return _config
|
||||
end
|
||||
|
||||
local elixir = require('elixir')
|
||||
elixir.setup(config({
|
||||
cmd = {"/Users/fbecker18/opt/elixir-ls/bin/language_server.sh"},
|
||||
-- repo = "mhanberg/elixir-ls", -- defaults to elixir-lsp/elixir-ls
|
||||
-- branch = "mh/all-workspace-symbols", -- defaults to nil, just checkouts out the default branch, mutually exclusive with the `tag` option
|
||||
settings = elixir.settings({
|
||||
dialyzerEnabled = true,
|
||||
fetchDeps = false,
|
||||
enableTestLenses = true,
|
||||
suggestSpecs = false,
|
||||
}),
|
||||
on_attach = function(client, bufnr)
|
||||
on_attach(client, bufnr)
|
||||
|
||||
local map_opts = { buffer = true, noremap = true}
|
||||
|
||||
-- remove the pipe operator
|
||||
vim.keymap.set("n", "<leader>fp", ":ElixirFromPipe<cr>", map_opts)
|
||||
-- add the pipe operator
|
||||
vim.keymap.set("n", "<leader>tp", ":ElixirToPipe<cr>", map_opts)
|
||||
vim.keymap.set("v", "<leader>em", ":ElixirExpandMacro<cr>", map_opts)
|
||||
end
|
||||
}))
|
||||
|
||||
-- Enable the following language servers
|
||||
@@ -144,6 +176,16 @@ for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup(config())
|
||||
end
|
||||
|
||||
lspconfig.sumneko_lua.setup(config({
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
||||
require('rust-tools').setup({
|
||||
tools = {
|
||||
inlay_hints = {
|
||||
|
@@ -1,12 +1,12 @@
|
||||
local saga = require 'lspsaga'
|
||||
saga.init_lsp_saga({
|
||||
-- symbols in winbar
|
||||
symbol_in_winbar = {
|
||||
enable = true,
|
||||
click_support = true,
|
||||
show_file = true,
|
||||
in_custom = true,
|
||||
},
|
||||
-- symbol_in_winbar = {
|
||||
-- enable = true,
|
||||
-- click_support = true,
|
||||
-- show_file = true,
|
||||
-- in_custom = true,
|
||||
-- },
|
||||
})
|
||||
|
||||
local function get_file_name(include_path)
|
||||
|
7
.config/nvim/after/plugin/luasnip.lua
Normal file
7
.config/nvim/after/plugin/luasnip.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
local luasnip = require('luasnip')
|
||||
luasnip.config.set_config {
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI"
|
||||
}
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
@@ -1,5 +1,6 @@
|
||||
require("neotest").setup({
|
||||
adapters = {
|
||||
require("neotest-vim-test")({ allow_file_types = { "haskell", "elixir" } }),
|
||||
require("neotest-vim-test")({ allow_file_types = { "haskell"} }),
|
||||
require("neotest-elixir")
|
||||
},
|
||||
})
|
||||
|
3
.config/nvim/after/plugin/notify.lua
Normal file
3
.config/nvim/after/plugin/notify.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
require('notify').setup({
|
||||
background_colour = "#000000",
|
||||
})
|
23
.config/nvim/after/plugin/orgmode.lua
Normal file
23
.config/nvim/after/plugin/orgmode.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
local orgmode = require('orgmode')
|
||||
|
||||
orgmode.setup_ts_grammar()
|
||||
|
||||
orgmode.setup({
|
||||
org_agenda_files = { '~/org/*' },
|
||||
org_default_notes_file = '~/org/inbox.org',
|
||||
org_todo_keywords = {'TODO(t)', 'WAITING(w)', '|', 'DONE(d)', 'CANCELLED(c)'},
|
||||
org_capture_templates = {
|
||||
t = {
|
||||
description = 'Todo',
|
||||
template = '* TODO %?\n %u',
|
||||
target = '~/org/inbox.org'
|
||||
},
|
||||
j = {
|
||||
description = 'Journal',
|
||||
template = '\n*** %<%Y-%m-%d> %<%A>\n**** %U\n\n%?',
|
||||
target = '~/org/journal.org'
|
||||
},
|
||||
},
|
||||
|
||||
})
|
||||
|
@@ -2,8 +2,8 @@ local Remap = require("halfdan.keymap")
|
||||
local nnoremap = Remap.nnoremap
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
nnoremap("<leader>ps", function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep For > ")})
|
||||
nnoremap("<leader>pg", function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep For > ")})
|
||||
end)
|
||||
nnoremap("<C-p>", function()
|
||||
if not pcall(builtin.git_files) then
|
||||
@@ -14,22 +14,22 @@ nnoremap("<Leader>pf", function()
|
||||
builtin.find_files()
|
||||
end)
|
||||
|
||||
nnoremap("<Leader>ps", function()
|
||||
builtin.lsp_workspace_symbols()
|
||||
end)
|
||||
nnoremap("<leader>pw", function()
|
||||
builtin.grep_string { search = vim.fn.expand("<cword>") }
|
||||
builtin.grep_string { search = vim.fn.expand("<cword>") }
|
||||
end)
|
||||
nnoremap("<leader>pb", function()
|
||||
builtin.buffers()
|
||||
builtin.buffers()
|
||||
end)
|
||||
nnoremap("<leader>vh", function()
|
||||
builtin.help_tags()
|
||||
builtin.help_tags()
|
||||
end)
|
||||
nnoremap("<leader>gw", function()
|
||||
require('telescope').extensions.git_worktree.git_worktrees()
|
||||
end)
|
||||
nnoremap("<leader>gc", function()
|
||||
builtin.git_branches()
|
||||
end)
|
||||
|
||||
-- Telescope
|
||||
-- nnoremap('<leader>fs', ':lua require(\'telescope.builtin\').grep_string({ search = vim.fn.input("Grep For > ")})<CR>')
|
||||
-- nnoremap('<Leader>ff', ':lua require(\'telescope.builtin\').find_files()<CR>')
|
||||
|
||||
-- nnoremap('<leader>fw', ':lua require(\'telescope.builtin\').grep_string { search = vim.fn.expand("<cword>") }<CR>')
|
||||
-- nnoremap('<leader>fb', ':lua require(\'telescope.builtin\').buffers()<CR>')
|
||||
-- nnoremap('<leader>vh', ':lua require(\'telescope.builtin\').help_tags()<CR>')
|
||||
-- nnoremap('<leader>gwl', ':lua require(\'telescope\').extensions.git_worktree.git_worktrees()<CR>')
|
||||
-- nnoremap('<leader>gwc', ':lua require(\'telescope\').extensions.git_worktree.create_git_worktree()<CR>')
|
||||
|
Reference in New Issue
Block a user