From 38e29f01ecb410eda6c51d21c065c04a8ec9695e Mon Sep 17 00:00:00 2001 From: Arkaprabha Chakraborty Date: Sun, 5 Mar 2023 06:47:18 +0530 Subject: [PATCH] Initial commit --- .gitignore | 1 + README.md | 23 +++++++ blob/neolite.png | Bin 0 -> 19596 bytes init.lua | 13 ++++ install.sh | 12 ++++ lua/buffer-tabs.lua | 13 ++++ lua/colorschemes.lua | 130 +++++++++++++++++++++++++++++++++++++++ lua/completions.lua | 82 ++++++++++++++++++++++++ lua/file-tree.lua | 67 ++++++++++++++++++++ lua/fuzzy-finder.lua | 38 ++++++++++++ lua/keybinds.lua | 75 ++++++++++++++++++++++ lua/lsp-config.lua | 45 ++++++++++++++ lua/lsp-format.lua | 29 +++++++++ lua/options.lua | 8 +++ lua/plugins.lua | 82 ++++++++++++++++++++++++ lua/statusline.lua | 45 ++++++++++++++ lua/syntax-highlight.lua | 42 +++++++++++++ lua/terminal.lua | 16 +++++ 18 files changed, 721 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 blob/neolite.png create mode 100644 init.lua create mode 100755 install.sh create mode 100644 lua/buffer-tabs.lua create mode 100644 lua/colorschemes.lua create mode 100644 lua/completions.lua create mode 100644 lua/file-tree.lua create mode 100644 lua/fuzzy-finder.lua create mode 100644 lua/keybinds.lua create mode 100644 lua/lsp-config.lua create mode 100644 lua/lsp-format.lua create mode 100644 lua/options.lua create mode 100644 lua/plugins.lua create mode 100644 lua/statusline.lua create mode 100644 lua/syntax-highlight.lua create mode 100644 lua/terminal.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7ad043 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +plugin/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..b37d22a --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +![neolite.png](blob/neolite.png) + +# Neolite + +## About + +Neolite is a fast and lightweight configuration of Neovim. + +## Installation + +- Clone the repository + +`git clone https://github.com/arkorty/Neolite.git` + +- Run the Install Script + +`./install.sh` + +- Close Neovim after Packer has installed all the required plugins + +- Run Neovim with Mason command + +`nvim +Mason` diff --git a/blob/neolite.png b/blob/neolite.png new file mode 100644 index 0000000000000000000000000000000000000000..b6ff6c42666c1d1699b0fb049a8bdf89b11452e3 GIT binary patch literal 19596 zcmeHu`9IX(_xN*=p=3!#Ok|f-WE-*-Vk%40i^?+DOZJ`cltNjfMG;ylLS-$>SR%VN zTb2=_?35+j_ueP-dcWU)!S{zx_wjhW%suDabI*3qJ@?FX%|K6k^G2SH2!d=T>1Y}v z2$KtfFc6s-0mQ+shydUx{ESRI49|J*a&dFEJ%7<=mxr&5%`O|C^R@`$)A=Rgbld=u zRddz%x*{EkoxzuoW$PZIxS}lXmQnXSe>{2NM`T@`p@1unFwS~)CMBqMa(|%aNfxaa zU(6i_(tdrMp+0`soHFAzDs8T|f9Yv~!;k)~t%393mL;ba+?K7n8n*R`tC?}}>y)w> zsYU-VZi`>>FjIZntd^PnCFbr-+sH-lnryYPnYo_seg3S0-aDRbN%@oiY;LcrT^Er# zQaR?7YIU}oQ*+wPdDp6KhUfCPiKX1~t0R5W6&aKLs5_*Xm1|;IE5=)sWPE$*3}?N{ z{%diM8Fm|fY!o%im#uv@&Cz#Z#pIaZ;8?TA9y!sTYX{vebE-I-#fnpwvQsQrJtn5v zMc8cp-(C0oKI*E^r!}=&6mjM8Vzf{I-O|d!LRi%SoxXi+?p7f}O>OKaKZ)fFD_`60 zWEB1Vcg|P=j)}v4PXy^OqouBqhVBQq{F~ucLTVwm?3hLL4P%XFY;P5X8^wKk)!Zm^ zJK6vBV4Ka+aLsfhX~R!8u^EQBpA9l)rDTnA(=VL*^wdoI)|uz6XI}X2W#!!S^qb>`NPd->8Hl>&N`RONhf$nO;dk-VC1q*K2ZPpbXueQB4N{f<|~gc zHW@EUkF@*N?>p<=o&R;*Kgk3AxLaFa#jEp&ooTAq_uCl-=5NPl530VJwU%3oeLZn^ zu|M-kLFSE|$$?ClPyVfi7iU#9-IPu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jFI6rVYKk(bZxFYJqBDleSnt8SI4${j`m{6Swr#A#qdKOX`EL?eRZGYe>-| zzDCKVlAf^d3x`C9j5j3boxRov?gxm}Hpdmm4xILMQumAu6 literal 0 HcmV?d00001 diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..5b38017 --- /dev/null +++ b/init.lua @@ -0,0 +1,13 @@ +require("plugins") +require("options") +require("keybinds") +require("statusline") +require("completions") +require("colorschemes") +require("file-tree") +require("terminal") +require("buffer-tabs") +require("fuzzy-finder") +require("syntax-highlight") +require("lsp-config") +require("lsp-format") diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..8ab44a2 --- /dev/null +++ b/install.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +git clone --depth 1 https://github.com/wbthomason/packer.nvim\ + ~/.local/share/nvim/site/pack/packer/start/packer.nvim + +[ -d "~/.config/nvim" ] && mv ~/.config/nvim ~/.config/nvim.bak + +[ ! -d "~/.config/nvim" ] && mkdir -p ~/.config/nvim + +cp -r init.lua lua ~/.config/nvim + +nvim +PackerSync diff --git a/lua/buffer-tabs.lua b/lua/buffer-tabs.lua new file mode 100644 index 0000000..3240452 --- /dev/null +++ b/lua/buffer-tabs.lua @@ -0,0 +1,13 @@ +-- set termguicolors to enable highlight groups +vim.opt.termguicolors = true + +local ok, bufferline = pcall(require, "bufferline") +if not ok then + return +end + +bufferline.setup({ + options = { + mode = "tabs", -- set to "buffers" to only show buffers instead + }, +}) diff --git a/lua/colorschemes.lua b/lua/colorschemes.lua new file mode 100644 index 0000000..f70505f --- /dev/null +++ b/lua/colorschemes.lua @@ -0,0 +1,130 @@ +local colorscheme = "onedark" + +if colorscheme == "onedark" then + -- Onedark Default Configuration + local ok, onedark = pcall(require, "onedark") + if not ok then + return + end + onedark.setup({ + -- Main options -- + style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light' + transparent = false, -- Show/hide background + term_colors = true, -- Change terminal color as per the selected theme style + ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden + cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu + -- toggle theme style --- + toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example 'ts' + toggle_style_list = { "dark", "darker", "cool", "deep", "warm", "warmer", "light" }, -- List of styles to toggle between + -- Change code style --- + -- Options are italic, bold, underline, none + -- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold' + code_style = { + comments = "italic", + keywords = "none", + functions = "none", + strings = "none", + variables = "none", + }, + -- Lualine options -- + lualine = { + transparent = false, -- lualine center bar transparency + }, + -- Custom Highlights -- + colors = {}, -- Override default colors + highlights = {}, -- Override highlight groups + -- Plugins Config -- + diagnostics = { + darker = true, -- darker colors for diagnostic + undercurl = true, -- use undercurl instead of underline for diagnostics + background = true, -- use background color for virtual text + }, + }) + + -- Load One Dark + require("onedark").load() +end + +if colorscheme == "catppuccin" then + -- Catppuccin + local ok, catppuccin = pcall(require, "catppuccin") + if not ok then + return + end + catppuccin.setup({ + flavour = "mocha", -- latte, frappe, macchiato, mocha + background = { + -- :h background + light = "latte", + dark = "mocha", + }, + transparent_background = false, + show_end_of_buffer = false, -- show the '~' characters after the end of buffers + term_colors = false, + dim_inactive = { + enabled = false, + shade = "dark", + percentage = 0.15, + }, + no_italic = false, -- Force no italic + no_bold = false, -- Force no bold + styles = { + comments = { "italic" }, + conditionals = { "italic" }, + loops = {}, + functions = {}, + keywords = {}, + strings = {}, + variables = {}, + numbers = {}, + booleans = {}, + properties = {}, + types = {}, + operators = {}, + }, + color_overrides = {}, + custom_highlights = {}, + integrations = { + cmp = true, + gitsigns = true, + nvimtree = true, + telescope = true, + notify = false, + mini = false, + -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) + }, + }) + + -- Load Catppuccin + require("catppuccin").load() +end + +if colorscheme == "gruvbox" then + -- setup must be called before loading the colorscheme + -- Default options: + local ok, gruvbox = pcall(require, "gruvbox") + if not ok then + return + end + + gruvbox.setup({ + undercurl = true, + underline = true, + bold = true, + italic = true, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + }) + + -- Load Gruvbox + require("gruvbox").load() +end diff --git a/lua/completions.lua b/lua/completions.lua new file mode 100644 index 0000000..1f7151b --- /dev/null +++ b/lua/completions.lua @@ -0,0 +1,82 @@ +local ok, cmp = pcall(require, "cmp") +if not ok then + return +end + +local luasnip_ok, luasnip = pcall(require, "luasnip") +if not luasnip_ok then + return +end + +local luasnip_vscode_ok, luasnip_vscode = pcall(require, "luasnip/loaders/from_vscode") +if not luasnip_vscode_ok then + return +end + +local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil +end + +luasnip_vscode.lazy_load() + +cmp.setup({ + view = { + --entries = { name = "custom", selection_order = "near_cursor" }, + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = { + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }, + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item) + local strings = vim.split(kind.kind, "%s", { trimempty = true }) + kind.kind = " " .. (strings[1] or "") .. " " + kind.menu = " (" .. (strings[2] or "") .. ")" + + return kind + end, + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }, + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + experimental = { + ghost_text = false, + }, +}) diff --git a/lua/file-tree.lua b/lua/file-tree.lua new file mode 100644 index 0000000..3610a47 --- /dev/null +++ b/lua/file-tree.lua @@ -0,0 +1,67 @@ +-- disable netrw +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- set termguicolors to enable highlight groups +vim.opt.termguicolors = true + +local ok, nvim_tree = pcall(require, "nvim-tree") +if not ok then + return +end + +-- file tree options +nvim_tree.setup({ + sort_by = "case_sensitive", + update_cwd = true, + renderer = { + group_empty = true, + root_folder_label = ":~:s?$?/..?", + }, + filters = { + dotfiles = true, + }, + view = { + side = "left", + width = 30, + hide_root_folder = false, + }, + actions = { + open_file = { + resize_window = true, + }, + }, + update_focused_file = { + enable = true, + update_cwd = true, + ignore_list = {}, + }, +}) + +-- open file tree at startup +local function open_nvim_tree(data) + -- buffer is a directory + local directory = vim.fn.isdirectory(data.file) == 1 + + if not directory then + return + end + + -- create a new, empty buffer + vim.cmd.enew() + + -- wipe the directory buffer + vim.cmd.bw(data.buf) + + -- change to the directory + vim.cmd.cd(data.file) + + -- open the tree + local api_ok, api = pcall(require, "nvim-tree.api") + if not api_ok then + return + end + api.tree.open() +end + +vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/lua/fuzzy-finder.lua b/lua/fuzzy-finder.lua new file mode 100644 index 0000000..0820942 --- /dev/null +++ b/lua/fuzzy-finder.lua @@ -0,0 +1,38 @@ +local status_ok, telescope = pcall(require, "telescope") +if not status_ok then + return +end + +telescope.setup({ + defaults = { + -- Default configuration for telescope goes here: + -- config_key = value, + mappings = { + i = { + -- map actions.which_key to (default: ) + -- actions.which_key shows the mappings for your picker, + -- e.g. git_{create, delete, ...}_branch for the git_branches picker + [""] = "which_key", + }, + }, + }, + pickers = { + -- Default configuration for builtin pickers goes here: + -- picker_name = { + -- picker_config_key = value, + -- ... + -- } + -- Now the picker_config_key will be applied every time you call this + -- builtin picker + find_files = { + hidden = false, + }, + }, + extensions = { + -- Your extension configuration goes here: + -- extension_name = { + -- extension_config_key = value, + -- } + -- please take a look at the readme of the extension you want to configure + }, +}) diff --git a/lua/keybinds.lua b/lua/keybinds.lua new file mode 100644 index 0000000..33122c8 --- /dev/null +++ b/lua/keybinds.lua @@ -0,0 +1,75 @@ +local opts = { noremap = true, silent = true } + +--local term_opts = { silent = true } +local bind = vim.api.nvim_set_keymap +local set = vim.keymap.set + +-- bind a leader key +bind("", ";", "", opts) -- undo any previous bind +vim.g.mapleader = ";" +vim.g.maplocalleader = ";" + +-- Modes +-- Normal Mode = 'n', +-- Insert Mode = 'i', +-- Visual Mode = 'v', +-- Visual Block Mode = 'x', +-- Terminal Mode = 't', +-- Command Mode = 'c', + +-- Normal mode -- +-- Basic functions +bind("n", "w", ":w", opts) +bind("n", "e", ":q", opts) +bind("n", "q", ":qa", opts) + +-- Nvim tree +bind("n", "", ":NvimTreeToggle", opts) + +-- Fuzzy finder +local telescope_status_ok, telescope = pcall(require, "telescope.builtin") +if telescope_status_ok then + set("n", "ff", telescope.find_files, {}) + set("n", "fg", telescope.live_grep, {}) + set("n", "fb", telescope.buffers, {}) + set("n", "fh", telescope.help_tags, {}) +end + +-- Better tabs +--bind("n", "n", ":tabnew", opts) +--bind("n", "c", ":tabclose", opts) +--bind("n", "l", ":tabnext", opts) +--bind("n", "h", ":tabprev", opts) + +-- Better window navigation +bind("n", "", "h", opts) +bind("n", "", "j", opts) +bind("n", "", "k", opts) +bind("n", "", "l", opts) + +-- Resize with arrows +bind("n", "", ":resize -2", opts) +bind("n", "", ":resize +2", opts) +bind("n", "", ":vertical resize -2", opts) +bind("n", "", ":vertical resize +2", opts) + +-- Navigate tabs +bind("n", "", ":tabnew", opts) +bind("n", "", ":tabclose", opts) +bind("n", "", ":tabp", opts) +bind("n", "", ":tabn", opts) + +-- Visual -- +-- Stay in indent mode +bind("v", "<", "", ">gv", opts) + +-- Move text up and down +bind("v", "", ":m .+1==", opts) +bind("v", "", ":m .-2==", opts) +bind("v", "p", '"_dP', opts) + +-- Visual Block -- +-- Move text up and down +bind("x", "J", ":move '>+1gv-gv", opts) +bind("x", "K", ":move '<-2gv-gv", opts) diff --git a/lua/lsp-config.lua b/lua/lsp-config.lua new file mode 100644 index 0000000..239f559 --- /dev/null +++ b/lua/lsp-config.lua @@ -0,0 +1,45 @@ +local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig") +if not lspconfig_status_ok then + return +end + +local mason_status_ok, mason = pcall(require, "mason") +if not mason_status_ok then + return +end + +local mason_lspconfig_status_ok, mason_lspconfig = pcall(require, "mason-lspconfig") +if not mason_lspconfig_status_ok then + return +end + +mason.setup({}) + +mason_lspconfig.setup({ + ensure_installed = { "lua_ls", "rust_analyzer", "clangd" }, +}) + +local capabilities = require("cmp_nvim_lsp").default_capabilities() + +mason_lspconfig.setup_handlers({ + function(server) + lspconfig[server].setup({ capabilities = capabilities }) + lspconfig.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + }, + }, + }) + end, + ["rust_analyzer"] = function() + local rt_ok, rust_tools = pcall(require, "rust-tools") + if rt_ok then + rust_tools.setup({}) + end + end +}) diff --git a/lua/lsp-format.lua b/lua/lsp-format.lua new file mode 100644 index 0000000..0ec2dec --- /dev/null +++ b/lua/lsp-format.lua @@ -0,0 +1,29 @@ +local ok, null_ls = pcall(require, "null-ls") +if not ok then + return +end + +local formatting = null_ls.builtins.formatting + +local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) +null_ls.setup({ + sources = { + formatting.rustfmt, + formatting.stylua, + formatting.black, + formatting.prettier, + }, -- you can reuse a shared lspconfig on_attach callback here + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead + vim.lsp.buf.format({ bufnr = bufnr }) + end, + }) + end + end, +}) diff --git a/lua/options.lua b/lua/options.lua new file mode 100644 index 0000000..fb247f9 --- /dev/null +++ b/lua/options.lua @@ -0,0 +1,8 @@ +vim.o.tabstop = 4 +vim.o.shiftwidth = 4 +vim.o.expandtab = true +vim.o.relativenumber = true +vim.o.smartindent = true +vim.o.syntax = true +vim.o.cursorline = true +vim.o.signcolumn = "number" diff --git a/lua/plugins.lua b/lua/plugins.lua new file mode 100644 index 0000000..4a28c17 --- /dev/null +++ b/lua/plugins.lua @@ -0,0 +1,82 @@ +local ok, packer = pcall(require, "packer") +if not ok then + return +end + +packer.startup(function(use) + -- Onedark colorscheme + use({ "navarasu/onedark.nvim" }) + + -- Gruvbox colorscheme + use({ "ellisonleao/gruvbox.nvim" }) + + -- Catppuccin colorscheme + use({ "catppuccin/nvim", as = "catppuccin" }) + + -- Plugin manager + use({ "wbthomason/packer.nvim" }) + + -- Terminal + use({ "akinsho/toggleterm.nvim", tag = "*" }) + + -- File tree + use({ + "nvim-tree/nvim-tree.lua", + requires = { + "nvim-tree/nvim-web-devicons", -- optional, for file icons + }, + tag = "nightly", -- optional, updated every week. (see issue #1193) + }) + + -- Statusline + use({ + "nvim-lualine/lualine.nvim", + requires = { "kyazdani42/nvim-web-devicons", opt = true }, + }) + + -- Buffer tabs + use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" }) + + use({ + "nvim-telescope/telescope.nvim", + tag = "0.1.1", + -- or , branch = '0.1.x', + requires = { { "nvim-lua/plenary.nvim" } }, + }) + + -- LSP manager + use({ "williamboman/mason.nvim" }) + use({ "williamboman/mason-lspconfig.nvim" }) + use({ "neovim/nvim-lspconfig" }) + + use({ "jose-elias-alvarez/null-ls.nvim" }) + + -- Completions + use("hrsh7th/nvim-cmp") -- The completion plugin + use("hrsh7th/cmp-buffer") -- buffer completions + use("hrsh7th/cmp-path") -- path completions + use("saadparwaiz1/cmp_luasnip") -- snippet completions + + use("onsails/lspkind.nvim") + use("windwp/nvim-autopairs") + use("hrsh7th/cmp-nvim-lsp") + + -- Snippets + use("L3MON4D3/LuaSnip") --snippet engine + use("rafamadriz/friendly-snippets") -- a bunch of snippets to use + + use({ + "nvim-treesitter/nvim-treesitter", + run = function() + local ts_update = require("nvim-treesitter.install").update({ with_sync = true }) + ts_update() + end, + }) + + --use 'neovim/nvim-lspconfig' + use 'simrat39/rust-tools.nvim' + + -- Debugging + --use 'nvim-lua/plenary.nvim' + use 'mfussenegger/nvim-dap' +end) diff --git a/lua/statusline.lua b/lua/statusline.lua new file mode 100644 index 0000000..515443d --- /dev/null +++ b/lua/statusline.lua @@ -0,0 +1,45 @@ +local ok, lualine = pcall(require, "lualine") +if not ok then + return +end + +lualine.setup({ + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, +}) diff --git a/lua/syntax-highlight.lua b/lua/syntax-highlight.lua new file mode 100644 index 0000000..00a8a30 --- /dev/null +++ b/lua/syntax-highlight.lua @@ -0,0 +1,42 @@ +local ok, nvim_treesitter = pcall(require, "nvim-treesitter.configs") +if not ok then + return +end + +nvim_treesitter.setup({ + -- A list of parser names, or "all" (the four listed parsers should always be installed) + ensure_installed = { "c", "help", "lua", "vim", "cpp", "rust" }, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + -- List of parsers to ignore installing (for "all") + ignore_install = { "javascript" }, + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + + highlight = { + enable = true, + -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to + -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is + -- the name of the parser) + -- list of language that will be disabled + disable = { "" }, + -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files + --disable = function(lang, buf) + -- local max_filesize = 100 * 1024 -- 100 KB + -- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + -- if ok and stats and stats.size > max_filesize then + -- return true + -- end + --end, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = true, + }, + indent = { enable = true, disable = { "yaml" } }, +}) diff --git a/lua/terminal.lua b/lua/terminal.lua new file mode 100644 index 0000000..5fb7c49 --- /dev/null +++ b/lua/terminal.lua @@ -0,0 +1,16 @@ +local ok, toggleterm = pcall(require, "toggleterm") +if not ok then + return +end + +toggleterm.setup({ + open_mapping = [[]], + hide_numbers = true, + start_in_insert = true, + direction = "float", + close_on_exit = true, + shell = vim.o.shell, + float_opts = { + border = "curved", + }, +})