From 173e25046f1bf8ff5b40849fc73833889d3f157e Mon Sep 17 00:00:00 2001 From: Vitor Gonçalves Date: Sat, 3 Feb 2024 11:56:21 -0300 Subject: nvim: fixed indentation, added treesitter/telescope --- .config/nvim/lua/config/init.lua | 8 +++++++- .config/nvim/lua/config/map.lua | 8 +++++++- .config/nvim/lua/config/plg.lua | 20 +++++++++++--------- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.config/nvim/lua/config/init.lua b/.config/nvim/lua/config/init.lua index c14e595..0a733d8 100644 --- a/.config/nvim/lua/config/init.lua +++ b/.config/nvim/lua/config/init.lua @@ -1,6 +1,6 @@ +require("config.plg") require("config.map") require("config.opt") -require("config.plg") -- Colorscheme configuration require("gruvbox").setup({ @@ -8,3 +8,9 @@ require("gruvbox").setup({ transparent_mode = true }) vim.cmd("colorscheme gruvbox") + +-- ensure highlighting +require("nvim-treesitter.configs").setup({ + ensure_installed = { "c", "lua", "go", "bash", "make", "html", "css" } +}) + diff --git a/.config/nvim/lua/config/map.lua b/.config/nvim/lua/config/map.lua index 24a286f..a64abed 100644 --- a/.config/nvim/lua/config/map.lua +++ b/.config/nvim/lua/config/map.lua @@ -1,3 +1,4 @@ +local tl = require("telescope.builtin") local key = vim.keymap vim.g.mapleader = " " @@ -11,4 +12,9 @@ key.set("n", "", "l") key.set("n", "", ":vs") key.set("n", "", ":sp") -key.set("n", "", ":nohlsearch", { silent = true }) +key.set("n", "", ":nohlsearch", { silent = true }) + +key.set("n", "ff", tl.find_files) +key.set("n", "f", tl.git_files) +key.set("n", "", tl.buffers) + diff --git a/.config/nvim/lua/config/plg.lua b/.config/nvim/lua/config/plg.lua index c08d99c..d1b9871 100644 --- a/.config/nvim/lua/config/plg.lua +++ b/.config/nvim/lua/config/plg.lua @@ -1,19 +1,21 @@ -- Initialize lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) end vim.opt.rtp:prepend(lazypath) local plugins = { - { "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...} + { "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...}, + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + { 'nvim-telescope/telescope.nvim', tag = '0.1.5', dependencies = { 'nvim-lua/plenary.nvim' } } } require("lazy").setup(plugins, {}) -- cgit 1.4.1-2-gfad0