Refine some more keybinds to new format and rework Telescope config
This commit is contained in:
parent
4d94052d70
commit
21284ab10d
|
@ -1,4 +1,3 @@
|
||||||
require 'autocmd'
|
|
||||||
require 'keybinds'
|
require 'keybinds'
|
||||||
require 'settings'
|
require 'settings'
|
||||||
require 'plugins/init'
|
require 'plugins/init'
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
local cmd = vim.cmd
|
|
||||||
|
|
||||||
-- Remap exit terminal mode to esc
|
|
||||||
cmd('au TermOpen * tnoremap <buffer> <Esc> <c-\\><c-n>')
|
|
||||||
|
|
||||||
-- Fix YAML indentation
|
|
||||||
cmd('au FileType yaml setlocal ts=2 sts=2 sw=2 expandtab')
|
|
|
@ -1,20 +1,12 @@
|
||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
|
|
||||||
-- Open/close tree browser
|
|
||||||
map('n', '<C-T>', '<cmd>NvimTreeToggle<CR>')
|
|
||||||
|
|
||||||
-- Telescope
|
-- Telescope
|
||||||
map('n', '<C-f>', '<cmd>Telescope find_files find_command=fd,-Ht,f<CR>')
|
--map('n', '<C-f>', '<cmd>Telescope find_files find_command=fd,-Ht,f<CR>')
|
||||||
map('n', '<C-g>', '<cmd>Telescope live_grep<CR>')
|
--map('n', '<C-g>', '<cmd>Telescope live_grep<CR>')
|
||||||
|
|
||||||
-- Completion
|
|
||||||
-- Navigate completions with tab and shift tab
|
|
||||||
map('i', '<S-Tab>', 'pumvisible() ? "\\<C-p>" : "\\<Tab>"', {expr = true})
|
|
||||||
map('i', '<Tab>', 'pumvisible() ? "\\<C-n>" : "\\<Tab>"', {expr = true})
|
|
||||||
|
|
||||||
-- Navigate between buffers
|
-- Navigate between buffers
|
||||||
map('n', '<C-N>', ':bn<CR>', {silent = true})
|
map('n', '<C-N>', vim.cmd.bn, {silent = true})
|
||||||
map('n', '<C-B>', ':bp<CR>', {silent = true})
|
map('n', '<C-B>', vim.cmd.bp, {silent = true})
|
||||||
|
|
||||||
-- Navigate between splits
|
-- Navigate between splits
|
||||||
map('n', '<C-H>', '<C-W><C-H>')
|
map('n', '<C-H>', '<C-W><C-H>')
|
||||||
|
@ -23,4 +15,7 @@ map('n', '<C-K>', '<C-W><C-K>')
|
||||||
map('n', '<C-L>', '<C-W><C-L>')
|
map('n', '<C-L>', '<C-W><C-L>')
|
||||||
|
|
||||||
-- Run Neoformat
|
-- Run Neoformat
|
||||||
map('n', '<M-f>', '<cmd>Neoformat<CR>')
|
map('n', '<M-f>', vim.cmd.Neoformat)
|
||||||
|
|
||||||
|
-- Exit terminal insert mode with esc
|
||||||
|
map('t', '<Esc>', '<C-\\><C-n>')
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
return function()
|
return function()
|
||||||
local telescope = require('telescope')
|
local telescope = require('telescope')
|
||||||
telescope.setup {}
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
|
telescope.setup {
|
||||||
|
pickers = {find_files = {find_command = {"fd", "-Ht", "f"}}}
|
||||||
|
}
|
||||||
|
|
||||||
telescope.load_extension('fzf')
|
telescope.load_extension('fzf')
|
||||||
telescope.load_extension('ui-select')
|
telescope.load_extension('ui-select')
|
||||||
|
|
||||||
|
-- Keybinds
|
||||||
|
vim.keymap.set('n', '<C-t>', vim.cmd.Telescope)
|
||||||
|
vim.keymap.set('n', '<C-f>', builtin.find_files)
|
||||||
|
vim.keymap.set('n', '<C-g>', builtin.live_grep)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue