Skip to content

Commit

Permalink
feat: Add telescope and toggleterm plugins (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpriscella committed Mar 31, 2024
1 parent e2d7726 commit 3352a52
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 7 deletions.
81 changes: 76 additions & 5 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)

vim.g.mapleader = ","

require("lazy").setup({
{
"iamcco/markdown-preview.nvim",
Expand All @@ -25,12 +27,24 @@ require("lazy").setup({
ft = { "markdown" },
build = function() vim.fn["mkdp#util#install"]() end,
},
{
'akinsho/bufferline.nvim',
version = "*",
dependencies = 'nvim-tree/nvim-web-devicons',
config = function()
require("bufferline").setup({
options = {
themable = true,
}
})
end
},
{
"nvim-lualine/lualine.nvim",
enabled = not vim.g.vscode,
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require('lualine').setup()
require("lualine").setup()
end
},
{
Expand All @@ -40,7 +54,12 @@ require("lazy").setup({
lazy = false,
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("nvim-tree").setup()
require("nvim-tree").setup({
view = {
side = "right",
width = 45
}
})
end,
},
{
Expand Down Expand Up @@ -71,10 +90,63 @@ require("lazy").setup({
config = function()
require("nvim-surround").setup()
end
},
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
},
{
'nvim-telescope/telescope.nvim',
tag = '0.1.6',
dependencies = { 'nvim-lua/plenary.nvim', 'BurntSushi/ripgrep' },
config = function()
local actions = require("telescope.actions")
local builtin = require('telescope.builtin')

local telescopeConfig = require("telescope.config")

-- Clone the default Telescope configuration
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }

-- I want to search in hidden/dot files.
table.insert(vimgrep_arguments, "--hidden")
-- I don't want to search in the `.git` directory.
table.insert(vimgrep_arguments, "--glob")
table.insert(vimgrep_arguments, "!**/.git/*")

require("telescope").setup{
defaults = {
mappings = {
i = {
["<C-u>"] = false,
["<esc>"] = actions.close
},
},
-- vimgrep_arguments = vimgrep_arguments,
},
pickers = {
find_files = {
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
},
},
}

vim.keymap.set('n', '<C-p>', builtin.find_files, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
end
},
{
'akinsho/toggleterm.nvim',
version = "*",
config = function()
require("toggleterm").setup{
open_mapping = [[<C-\>]],
}
end
}
})


----------------
--- SETTINGS ---
----------------
Expand All @@ -90,8 +162,6 @@ end

vim.opt.clipboard = "unnamed,unnamedplus"

vim.g.mapleader = ","

vim.opt.expandtab = true -- Use spaces instead of tabs.
vim.opt.ignorecase = true -- Ignore case when searching.
vim.opt.smartindent = true -- Autoindent when starting a new line.
Expand Down Expand Up @@ -126,3 +196,4 @@ vim.keymap.set("n", "<C-h>", ":wincmd h<CR>", { silent = true })
vim.keymap.set("n", "<C-j>", ":wincmd j<CR>", { silent = true })
vim.keymap.set("n", "<C-k>", ":wincmd k<CR>", { silent = true })
vim.keymap.set("n", "<C-l>", ":wincmd l<CR>", { silent = true })

4 changes: 2 additions & 2 deletions dotfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ clean_up() {
#######################################
install_dependencies() {
if [ "${ADJUSTED_ID}" = "debian" ]; then
check_packages ack curl exuberant-ctags gawk git jq locales python3 tar tmux vim virt-what zsh nodejs npm # Maybe not nodejs? Maybe npm installs it for us.
check_packages ack curl exuberant-ctags gawk git jq locales python3 ripgrep tar tmux vim virt-what zsh nodejs npm # Maybe not nodejs? Maybe npm installs it for us.
npm install -g tree-sitter-cli
install_neovim >/dev/null 2>&1
elif [ "${ADJUSTED_ID}" = "darwin" ]; then
brew tap homebrew/cask-fonts
brew install --casks dbeaver-community font-space-mono-nerd-font
check_packages derailed/k9s/k9s dive gh helm jq kind neovim shellcheck sslscan step tmux yq yt-dlp
check_packages derailed/k9s/k9s dive gh helm jq kind neovim ripgrep shellcheck sslscan step tmux yq yt-dlp
fi

clean_up
Expand Down

0 comments on commit 3352a52

Please sign in to comment.