nvim-treesitter, updated keybindings, and conf telescope
This commit is contained in:
parent
633eab5ec8
commit
b7939c98bb
2 changed files with 39 additions and 9 deletions
|
@ -37,7 +37,7 @@ map('n', '<leader>o', '<cmd>only<cr>')
|
||||||
map('n', '<esc>', '<cmd>nohlsearch<cr>')
|
map('n', '<esc>', '<cmd>nohlsearch<cr>')
|
||||||
|
|
||||||
wk.register({
|
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' },
|
['/'] = { '<cmd>Telescope live_grep<cr>', 'Search project' },
|
||||||
['<tab>'] = { '<cmd>NERDTreeToggle<cr>', 'Toggle NERDTree' },
|
['<tab>'] = { '<cmd>NERDTreeToggle<cr>', 'Toggle NERDTree' },
|
||||||
|
|
||||||
|
@ -45,8 +45,8 @@ wk.register({
|
||||||
name = 'file',
|
name = 'file',
|
||||||
e = { '<cmd>Telescope find_files cwd=~/.config/nvim<cr>', 'Find file in .config/nvim' },
|
e = { '<cmd>Telescope find_files cwd=~/.config/nvim<cr>', 'Find file in .config/nvim' },
|
||||||
E = { '<cmd>e ~/.config/nvim<cr>', 'Browse .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 cwd=~/ hidden=true no_ignore=true no_ignore_parent=true follow=true theme=dropdown<cr>', 'Find file' },
|
||||||
F = { '<cmd>Telescope find_files<cr>', 'File file from here' },
|
F = { '<cmd>Telescope find_files theme=dropdown<cr>', 'File file from here' },
|
||||||
l = { '<cmd>NERDTreeFind<cr>', 'Locate file' },
|
l = { '<cmd>NERDTreeFind<cr>', 'Locate file' },
|
||||||
r = { '<cmd>Telescope oldfiles<cr>', 'Recent files' },
|
r = { '<cmd>Telescope oldfiles<cr>', 'Recent files' },
|
||||||
},
|
},
|
||||||
|
@ -64,13 +64,24 @@ wk.register({
|
||||||
g = {
|
g = {
|
||||||
name = 'git',
|
name = 'git',
|
||||||
s = { '<cmd>Git<cr>', 'Status' },
|
s = { '<cmd>Git<cr>', 'Status' },
|
||||||
f = { '<cmd>Git fetch<cr>', 'Fetch' },
|
|
||||||
p = { '<cmd>Git push --force-with-lease -u origin head<cr>', 'Push' },
|
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 = {
|
r = {
|
||||||
name = 'rebase',
|
name = 'rebase',
|
||||||
m = { '<cmd>Git rebase origin/main<cr>', 'origin/main' },
|
o = { '<cmd>Git rebase origin/main<cr>', 'origin/main' },
|
||||||
M = { '<cmd>Git rebase --interactive origin/main<cr>', 'Interactive 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>' })
|
}, { prefix = '<leader>' })
|
||||||
|
|
|
@ -3,7 +3,7 @@ local ensure_packer = function()
|
||||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
|
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
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
@ -42,15 +42,34 @@ return require('packer').startup(function(use)
|
||||||
'kana/vim-textobj-line',
|
'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 {
|
use {
|
||||||
'nvim-telescope/telescope.nvim', tag = '0.1.0',
|
'nvim-telescope/telescope.nvim', tag = '0.1.0',
|
||||||
requires = {
|
requires = {
|
||||||
{ 'nvim-lua/plenary.nvim' },
|
{ '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()
|
config = function()
|
||||||
require('telescope').setup()
|
require('telescope').setup({
|
||||||
|
defaults = { preview = false }
|
||||||
|
})
|
||||||
require('telescope').load_extension('fzf')
|
require('telescope').load_extension('fzf')
|
||||||
|
require('telescope').load_extension('emoji')
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue