From e93f9c7196ace1f2b7b613916ee686792d77447c Mon Sep 17 00:00:00 2001 From: surdeus Date: Mon, 3 Jun 2024 22:48:28 +0500 Subject: [PATCH] ... --- nvim/init.lua | 26 +++++++--------------- nvim/lua/bootstrap.lua | 10 ++++----- nvim/lua/filetypes.lua | 46 ++++++++++++++++++++++++++++++++++++++ nvim/lua/general.lua | 36 ++++++++++++++++++++++++++++++ nvim/lua/indent.lua | 50 ++---------------------------------------- 5 files changed, 97 insertions(+), 71 deletions(-) create mode 100644 nvim/lua/general.lua diff --git a/nvim/init.lua b/nvim/init.lua index 1375056..60048c7 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -7,30 +7,20 @@ for name, _ in pairs(package.loaded) do package.loaded[name] = nil end -vim.cmd.language("en_US") -vim.opt.tildeop = true -vim.opt.swapfile = false - -vim.o.number = true -vim.o.cursorline = true -vim.o.guicursor = 'n-v-c-sm-i-ci-ve:block,r-cr-o:hor20,a:blinkoff700-blinkoff400-blinkoff250-Cursor/lCursor' -vim.opt.listchars = { - tab = '|-', - trail = '.', - lead = '.', -} -vim.opt.list = true +require("general") require("indent") require("maps") require("filetypes") -local hls = require("color.night").hls -require("color").apply_hls((hls)) +local color = require("color") + +local night = require("color.night") +color.apply_hls(night.hls) --require'lspconfig'.gopls.setup{} -require("bootstrap") -require("dep") { -} +--require("bootstrap") +--require("dep") { +--} diff --git a/nvim/lua/bootstrap.lua b/nvim/lua/bootstrap.lua index 5dffe5d..af955e8 100644 --- a/nvim/lua/bootstrap.lua +++ b/nvim/lua/bootstrap.lua @@ -1,9 +1,9 @@ -- Installing the dep package manager -local path = vim.fn.stdpath("data") .. "/site/pack/deps/opt/dep" +--local path = vim.fn.stdpath("data") .. "/site/pack/deps/opt/dep" -if vim.fn.empty(vim.fn.glob(path)) > 0 then - vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/chiyadev/dep", path }) -end +-- if vim.fn.empty(vim.fn.glob(path)) > 0 then + -- vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/chiyadev/dep", path }) +-- end -vim.cmd("packadd dep") +-- vim.cmd("packadd dep") diff --git a/nvim/lua/filetypes.lua b/nvim/lua/filetypes.lua index ffb1ed0..119e683 100644 --- a/nvim/lua/filetypes.lua +++ b/nvim/lua/filetypes.lua @@ -4,3 +4,49 @@ vim.filetype.add({ pmd = "markdown", }, }) + +createAutoCmd = vim.api.nvim_create_autocmd +-- +-- Basic thing for compiling languages. +createAutoCmd({ + "BufNewFile", + "BufRead", +},{ + pattern = "*.tengo,*.go,*.c,*.cc,*.C,*.cpp,*.rs,*.lua,*.sql,*.tengo,*.xgo", + callback = function() + local buf = vim.bo[vim.api.nvim_get_current_buf()] + vim.o.expandtab = false + vim.o.tabstop = 4 + vim.o.shiftwidth = 4 + end, +}) + +createAutoCmd({ + "BufNewFile", + "BufRead", +},{ + pattern = "*.md,*.pmd,*.txt,*.js,*.jsx,*.scss".. + ",*.css,*.sass,*.htm,*.html,*.htmlx,*.tmpl".. + ",*.tpl,*.yml,*.yaml,*.toml,*.tml", + callback = function() + local buf = vim.bo[vim.api.nvim_get_current_buf()] + buf.expandtab = true + buf.shiftwidth=2 + buf.tabstop=2 + buf.softtabstop = 0 + end, +}) + +createAutoCmd({ + "BufNewFile", + "BufRead", +},{ + pattern = "*.py", + callback = function() + local buf = vim.bo[vim.api.nvim_get_current_buf()] + buf.expandtab = true + buf.shiftwidth=4 + buf.tabstop=4 + buf.softtabstop = 0 + end, +}) diff --git a/nvim/lua/general.lua b/nvim/lua/general.lua new file mode 100644 index 0000000..48f065b --- /dev/null +++ b/nvim/lua/general.lua @@ -0,0 +1,36 @@ +vim.cmd("syntax off") + +-- The standard. +vim.cmd.language("en_US") + +-- Fucking hate swapfiles. +vim.opt.swapfile = false + +-- Show line number. +vim.o.number = true +-- +vim.o.cursorline = true + +-- For quick changing of character case. +vim.opt.tildeop = true + +-- Cursor stuff. +vim.o.guicursor = 'n-v-c-sm-i-ci-ve:block,r-cr-o:hor20,a:blinkoff700-blinkoff400-blinkoff250-Cursor/lCursor' + +-- To see more. +vim.opt.listchars = { + tab = '|-', + trail = '.', + lead = '.', +} + +-- Should recall later. +vim.opt.list = true + +-- Golang, C based configuration +vim.o.expandtab = false +vim.o.autoindent = true +vim.o.foldmethod = 'indent' +vim.o.tabstop = 4 +vim.o.shiftwidth = 4 + diff --git a/nvim/lua/indent.lua b/nvim/lua/indent.lua index 7e44328..3f2ff2d 100644 --- a/nvim/lua/indent.lua +++ b/nvim/lua/indent.lua @@ -1,51 +1,5 @@ --- Golang, C based configuration -vim.o.autoindent = true -vim.o.foldmethod = 'indent' - -createAutoCmd = vim.api.nvim_create_autocmd - --- Basic thing for compiling languages. -createAutoCmd({ - "BufNewFile", - "BufRead", -},{ - pattern = "*.go,*.c,*.cc,*.C,*.cpp,*.rs,*.lua,*.sql", - callback = function() - local buf = vim.bo[vim.api.nvim_get_current_buf()] - vim.o.expandtab = false - vim.o.tabstop = 4 - vim.o.shiftwidth = 4 - end, -}) - -createAutoCmd({ - "BufNewFile", - "BufRead", -},{ - pattern = "*.md,*.pmd,*.txt,*.js,*.jsx,*.scss,*.css,*.sass,*.htm,*.html,*.htmlx,*.tmpl,*.tpl,*.yml,*.yaml,*.toml,*.tml", - callback = function() - local buf = vim.bo[vim.api.nvim_get_current_buf()] - buf.expandtab = true - buf.shiftwidth=2 - buf.tabstop=2 - buf.softtabstop = 0 - end, -}) - -createAutoCmd({ - "BufNewFile", - "BufRead", -},{ - pattern = "*.py", - callback = function() - local buf = vim.bo[vim.api.nvim_get_current_buf()] - buf.expandtab = true - buf.shiftwidth=4 - buf.tabstop=4 - buf.softtabstop = 0 - end, -}) - + +