nvim-treesitter, updated keybindings, and conf telescope

This commit is contained in:
Sloane Perrault 2023-04-05 07:57:14 -04:00
parent 633eab5ec8
commit b7939c98bb
No known key found for this signature in database
2 changed files with 39 additions and 9 deletions

View file

@ -37,7 +37,7 @@ map('n', '<leader>o', '<cmd>only<cr>')
map('n', '<esc>', '<cmd>nohlsearch<cr>')
wk.register({
['<space>'] = { '<cmd>Telescope find_files<cr>', 'File file in project' },
['<space>'] = { '<cmd>Telescope find_files theme=dropdown<cr>', 'File file in project' },
['/'] = { '<cmd>Telescope live_grep<cr>', 'Search project' },
['<tab>'] = { '<cmd>NERDTreeToggle<cr>', 'Toggle NERDTree' },
@ -45,8 +45,8 @@ wk.register({
name = 'file',
e = { '<cmd>Telescope find_files cwd=~/.config/nvim<cr>', 'Find file in .config/nvim' },
E = { '<cmd>e ~/.config/nvim<cr>', 'Browse .config/nvim' },
f = { '<cmd>Telescope find_files cwd=~/ hidden=true no_ignore=true no_ignore_parent=true follow=true<cr>', 'Find file' },
F = { '<cmd>Telescope find_files<cr>', 'File file from here' },
f = { '<cmd>Telescope find_files cwd=~/ hidden=true no_ignore=true no_ignore_parent=true follow=true theme=dropdown<cr>', 'Find file' },
F = { '<cmd>Telescope find_files theme=dropdown<cr>', 'File file from here' },
l = { '<cmd>NERDTreeFind<cr>', 'Locate file' },
r = { '<cmd>Telescope oldfiles<cr>', 'Recent files' },
},
@ -64,13 +64,24 @@ wk.register({
g = {
name = 'git',
s = { '<cmd>Git<cr>', 'Status' },
f = { '<cmd>Git fetch<cr>', 'Fetch' },
p = { '<cmd>Git push --force-with-lease -u origin head<cr>', 'Push' },
f = {
name = 'fetch',
o = { '<cmd>Git fetch origin<cr>', 'origin' },
u = { '<cmd>Git fetch upstream<cr>', 'upstream' },
},
r = {
name = 'rebase',
m = { '<cmd>Git rebase origin/main<cr>', 'origin/main' },
M = { '<cmd>Git rebase --interactive origin/main<cr>', 'Interactive origin/main' }
o = { '<cmd>Git rebase origin/main<cr>', 'origin/main' },
O = { '<cmd>Git rebase --interactive origin/main<cr>', '-i origin/main' },
u = { '<cmd>Git rebase upstream/main<cr>', 'upstream/main' },
U = { '<cmd>Git rebase upstream/main<cr>', '-i upstream/main' },
}
},
i = {
name = 'insert',
e = { '<cmd>Telescope emoji theme=dropdown<cr>', 'emoji' },
},
}, { prefix = '<leader>' })

View file

@ -3,7 +3,7 @@ local ensure_packer = function()
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
vim.cmd [[packadd packer.nvim]]
vim.cmd 'packadd packer.nvim'
return true
end
return false
@ -42,15 +42,34 @@ return require('packer').startup(function(use)
'kana/vim-textobj-line',
}
use 'sheerun/vim-polyglot'
use {
'nvim-treesitter/nvim-treesitter',
run = function()
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
ts_update()
end,
config = function()
require('nvim-treesitter.configs').setup({
indent = { enable = true },
highlight = { enable = true },
})
end,
}
use {
'nvim-telescope/telescope.nvim', tag = '0.1.0',
requires = {
{ 'nvim-lua/plenary.nvim' },
{ 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
{ 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
{ 'xiyaowong/telescope-emoji.nvim' },
},
config = function()
require('telescope').setup()
require('telescope').setup({
defaults = { preview = false }
})
require('telescope').load_extension('fzf')
require('telescope').load_extension('emoji')
end
}