rice/dots/.config/nvim/lua/main/init.lua
2021-11-30 13:53:58 +02:00

103 lines
2.6 KiB
Lua

local base16 = require "base16"
require "plugins"
-- thanks nvchad for the telescope config
require("telescope").setup {
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
},
prompt_prefix = "",
selection_caret = " ",
entry_prefix = " ",
initial_mode = "insert",
selection_strategy = "reset",
sorting_strategy = "ascending",
layout_strategy = "horizontal",
layout_config = {
horizontal = {
prompt_position = "top",
preview_width = 0.55,
results_width = 0.8,
},
vertical = {
mirror = false,
},
width = 0.87,
height = 0.80,
preview_cutoff = 120,
},
file_sorter = require("telescope.sorters").get_fuzzy_file,
file_ignore_patterns = { "node_modules" },
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
path_display = { "absolute" },
winblend = 0,
border = {},
borderchars = { "", "", "", "", "", "", "", "" },
color_devicons = true,
use_less = true,
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
}
}
require("nvim-treesitter.configs").setup {
highlight = {
enable = true,
disable = {},
},
indent = {
enable = false,
disable = {},
},
ensure_installed = {
"json",
"html",
"scss",
"javascript",
"css",
"c",
"cpp",
"rust"
},
}
local options = {
tabstop = 4,
shiftwidth = 4,
expandtab = true,
smartindent = true,
smartcase = true,
mouse = "a",
termguicolors = true,
cmdheight = 1
}
local init = {
"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>"
}
for k, v in pairs(options) do
vim.o[k] = v
end
for i, v in pairs(init) do
vim.cmd(v)
end
base16.apply_theme(base16.themes["tomorrow-night"], true)