Browse Source

telescope, fzf and gitsigns

master
Ivan Polyakov 2 years ago
parent
commit
1cbee3dc99
  1. 1
      .config/nvim/init.lua
  2. 36
      .config/nvim/lua/init/plugins.lua
  3. 25
      .config/nvim/lua/init/treesitter.lua
  4. 7
      .config/nvim/lua/plugins.lua

1
.config/nvim/init.lua

@ -2,4 +2,5 @@ vim.cmd('source ~/.vim/init/general.vim')
require 'init.plugins' require 'init.plugins'
require 'init.gitsigns' require 'init.gitsigns'
require 'init.treesitter'
require 'init.lsp_and_cmp' require 'init.lsp_and_cmp'

36
.config/nvim/lua/init/plugins.lua

@ -1,8 +1,14 @@
vim.cmd('colorscheme nord')
vim.cmd('source ~/.vim/init/vimtex.vim') vim.cmd('source ~/.vim/init/vimtex.vim')
require 'plugins' vim.g.nord_borders = true
require 'lualine'.setup{}
require('plugins')
require('nord').set()
require('lualine').setup {
options = {
theme = 'nord',
}
}
vim.cmd [[ vim.cmd [[
"" Snippets "" Snippets
@ -12,3 +18,27 @@ vim.cmd [[
smap <expr> <S-Tab> snippy#can_jump(-1) ? '<Plug>(snippy-previous)' : '<S-Tab>' smap <expr> <S-Tab> snippy#can_jump(-1) ? '<Plug>(snippy-previous)' : '<S-Tab>'
xmap <Tab> <Plug>(snippy-cut-text) xmap <Tab> <Plug>(snippy-cut-text)
]] ]]
-- You dont need to set any of these options. These are the default ones. Only
-- the loading is important
require('telescope').setup {
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
}
}
}
-- To get fzf loaded and working with telescope, you need to call
-- load_extension, somewhere after setup function:
require('telescope').load_extension('fzf')
vim.cmd [[
nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>
nnoremap <leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>
nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>
nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>
]]

25
.config/nvim/lua/init/treesitter.lua

@ -0,0 +1,25 @@
local ok, configs = pcall(require, "nvim-treesitter.configs")
if not ok then
return
end
configs.setup {
ensure_installed = {
"c", "cpp", "lua", "scheme", "vue", "javascript", "pug"
},
sync_install = false,
ignore_install = { "" },
autopairs = {
enable = true,
},
highlight = {
enable = true,
disable = { "" },
additional_vim_regex_highlighting = true,
},
indent = { enable = true, disable = { "yaml" } },
context_commentstring = {
enable = true,
enable_autocmd = false,
},
}

7
.config/nvim/lua/plugins.lua

@ -41,4 +41,11 @@ return require('packer').startup(function()
-- Another tools -- -- Another tools --
use 'MunifTanjim/nui.nvim' -- UI framework use 'MunifTanjim/nui.nvim' -- UI framework
use {
'nvim-telescope/telescope.nvim', tag = '0.1.0',
requires = { {'nvim-lua/plenary.nvim'} }
}
use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
end) end)

Loading…
Cancel
Save