aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kdx@42l.fr>2023-01-19 19:29:37 +0100
committerkdx <kdx@42l.fr>2023-01-19 19:29:37 +0100
commitbb0daae8e79b8f1aca621bcd20f7851be1e208e4 (patch)
treedec503267b86194907d641881d9a6ccc44c741e4
downloadnvim-config-bb0daae8e79b8f1aca621bcd20f7851be1e208e4.tar.gz
initial commit
-rw-r--r--init.lua21
-rw-r--r--map.lua7
-rw-r--r--plugs.lua9
-rw-r--r--treesitter.lua31
4 files changed, 68 insertions, 0 deletions
diff --git a/init.lua b/init.lua
new file mode 100644
index 0000000..e0bde46
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,21 @@
+local cfg = "/home/kdx/.config/nvim/"
+dofile(cfg .. "map.lua")
+dofile(cfg .. "plugs.lua")
+dofile(cfg .. "treesitter.lua")
+
+local indent = 8
+
+vim.opt.tabstop = indent
+vim.opt.shiftwidth = indent
+vim.opt.colorcolumn = "80"
+vim.opt.number = true
+vim.opt.relativenumber = true
+vim.opt.mouse = "a"
+vim.opt.laststatus = 2
+vim.opt.hlsearch = true
+vim.opt.incsearch = true
+vim.opt.showmatch = true
+vim.opt.autoindent = true
+vim.opt.ttyfast = true
+
+map('n', '<space>', ':noh<cr>')
diff --git a/map.lua b/map.lua
new file mode 100644
index 0000000..bec3c8f
--- /dev/null
+++ b/map.lua
@@ -0,0 +1,7 @@
+function map(mode, combo, mapping, opts)
+ local options = {noremap = true}
+ if opts then
+ options = vim.tbl_extend("force", options, opts)
+ end
+ vim.api.nvim_set_keymap(mode, combo, mapping, options)
+end
diff --git a/plugs.lua b/plugs.lua
new file mode 100644
index 0000000..e931e42
--- /dev/null
+++ b/plugs.lua
@@ -0,0 +1,9 @@
+require("paq")({
+ "savq/paq-nvim";
+ {
+ "nvim-treesitter/nvim-treesitter",
+ run=function()
+ vim.cmd("TSUpdate")
+ end
+ };
+})
diff --git a/treesitter.lua b/treesitter.lua
new file mode 100644
index 0000000..d28c99d
--- /dev/null
+++ b/treesitter.lua
@@ -0,0 +1,31 @@
+require("nvim-treesitter.configs").setup {
+ ensure_installed = {
+ "bash",
+ "c",
+ "cpp",
+ "glsl",
+ "lua",
+ "rust",
+ "zig",
+ },
+ sync_install = false,
+ auto_install = true,
+ highlight = {
+ enable = true,
+ additional_vim_regex_highlighting = false,
+ },
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ init_selection = "gnn",
+ node_incremental = "grn",
+ scope_incremental = "grc",
+ node_decremental = "grm",
+ },
+ },
+ indent = { enable = true },
+}
+
+vim.opt.foldmethod = "expr"
+vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
+vim.opt.foldenable = false