summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/init.lua4
-rw-r--r--.config/nvim/lazy-lock.json6
-rw-r--r--.config/nvim/lua/user/beautiful.lua6
-rw-r--r--.config/nvim/lua/user/options.lua35
-rw-r--r--.config/nvim/lua/user/plugins.lua35
-rw-r--r--.config/nvim/lua/user/remaps.lua58
6 files changed, 144 insertions, 0 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
new file mode 100644
index 0000000..6eafd2c
--- /dev/null
+++ b/.config/nvim/init.lua
@@ -0,0 +1,4 @@
+require "user.options"
+require "user.remaps"
+require "user.plugins"
+require "user.beautiful"
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json
new file mode 100644
index 0000000..c7e83a4
--- /dev/null
+++ b/.config/nvim/lazy-lock.json
@@ -0,0 +1,6 @@
+{
+ "awesome-vim-colorschemes": { "branch": "master", "commit": "4b2787b8894c4a70c42d15c2808d7cf278cb6abb" },
+ "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
+ "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" },
+ "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
+} \ No newline at end of file
diff --git a/.config/nvim/lua/user/beautiful.lua b/.config/nvim/lua/user/beautiful.lua
new file mode 100644
index 0000000..17b7ed5
--- /dev/null
+++ b/.config/nvim/lua/user/beautiful.lua
@@ -0,0 +1,6 @@
+-- this file contains configuration for colorschemes e.t.c
+
+local colorscheme = "habamax"
+-- local colorscheme = "evening"
+vim.cmd("colo " .. colorscheme)
+
diff --git a/.config/nvim/lua/user/options.lua b/.config/nvim/lua/user/options.lua
new file mode 100644
index 0000000..a8e58bc
--- /dev/null
+++ b/.config/nvim/lua/user/options.lua
@@ -0,0 +1,35 @@
+-- this file contains general options for nvim
+
+local o = vim.opt
+
+local options = {
+ -- general options
+ backup = false,
+ clipboard = "unnamedplus",
+ cmdheight = 1,
+ conceallevel = 0,
+ fileencoding = "utf-8",
+ hlsearch = true,
+ mouse = "a",
+ showmode = true,
+ tabstop = 8,
+ shiftwidth = 8,
+ smartindent = true,
+ swapfile = false,
+ timeoutlen = 1000, --ms
+ updatetime = 300,
+ writebackup = false,
+ expandtab = false, -- !!!!!!!!!
+ cursorline = false,
+ number = true,
+ wrap = false,
+ -- splitting
+ splitbelow = true,
+ splitright = true,
+}
+
+for key, val in pairs(options) do
+ o[key] = val
+end
+
+-- vim.cmd('colo evening')
diff --git a/.config/nvim/lua/user/plugins.lua b/.config/nvim/lua/user/plugins.lua
new file mode 100644
index 0000000..2344087
--- /dev/null
+++ b/.config/nvim/lua/user/plugins.lua
@@ -0,0 +1,35 @@
+-- this file contains plugin settings as well as initialization of lazy.nvim
+
+
+-- plugins to be installed
+plugins = {
+ "folke/lazy.nvim", -- plugin manager
+ "folke/which-key.nvim", -- pretty self-descriptive name
+ "rafi/awesome-vim-colorschemes", -- same here
+ "tpope/vim-commentary" -- gc & gcc for commenting
+}
+
+-- options for lazy
+opts = {
+
+}
+
+
+-- some lazy.nvim magic
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not vim.loop.fs_stat(lazypath) then
+ vim.fn.system({
+ "git",
+ "clone",
+ "--filter=blob:none",
+ "https://github.com/folke/lazy.nvim.git",
+ "--branch=stable", -- latest stable release
+ lazypath,
+ })
+end
+vim.opt.rtp:prepend(lazypath)
+
+-- initialization
+lazy = require("lazy")
+lazy.setup(plugins, opts)
+
diff --git a/.config/nvim/lua/user/remaps.lua b/.config/nvim/lua/user/remaps.lua
new file mode 100644
index 0000000..742e967
--- /dev/null
+++ b/.config/nvim/lua/user/remaps.lua
@@ -0,0 +1,58 @@
+-- this file contains general remappings for this nvim configuration
+
+local opt = { noremap = true, silent = true }
+
+local map = vim.api.nvim_set_keymap
+
+map("", "\\", "<Nop>", opt)
+vim.g.mapleader = "\\"
+
+-- some minor commands
+map("c", "w!!", "w !sudo tee % > /dev/null", opt)
+
+-- remap j and k
+-- i refuse to elaborate
+map("n", "j", "<Up>", opt)
+map("n", "k", "<Down>", opt)
+
+-- window navigation
+map("n", "<C-l>", "<C-w>l", opt)
+map("n", "<C-j>", "<C-w>k", opt) -- SWITCHED K AND J
+map("n", "<C-k>", "<C-w>j", opt) -- SWITCHED K AND J
+map("n", "<C-h>", "<C-w>h", opt)
+
+-- Insert mode navigation
+map("i", "<C-h>", "<Left>", opt)
+map("i", "<C-j>", "<Up>", opt) -- SWITCHED K AND J
+map("i", "<C-k>", "<Down>", opt) -- SWITCHED K AND J
+map("i", "<C-l>", "<Right>", opt)
+
+-- lexer options..?
+map("n", "<leader>e", ":Lex 49<cr>", opt)
+
+-- resizing options
+map("n", "<C-Left>", ":vertical resize -5<cr>", opt)
+map("n", "<C-Up>", ":resize +5<cr>", opt)
+map("n", "<C-Right>", ":vertical resize +5<cr>", opt)
+map("n", "<C-Down>", ":resize -5<cr>", opt)
+
+-- better indentation
+map("v", "<", "<gv", opt)
+map("v", ">", ">gv", opt)
+
+-- moving lines
+map("n", "<A-j>", ":m .-2<CR>==", opt) -- SWITCHED K AND J
+map("n", "<A-k>", ":m .+1<CR>==", opt) -- SWITCHED K AND J
+
+-- duplicating lines
+map("n", "<C-Up>", ":.,.t.-1<CR>==", opt)
+map("n", "<C-Down>", ":.,.t.<CR>==", opt)
+
+-- leader remaps
+map("n", "<leader>/", ":nohlsearch<CR>", opt) -- discard search highlighting
+map("n", "<leader>T", ":term<CR>", opt) -- open terminal fullscreen with \T
+map("n", "<leader>t", ":vsplit term <CR>", opt) -- split to terminal with \t
+map("n", "<leader>pl", ":Lazy<CR>", opt) -- open plugin manager
+
+-- miscellaneous
+map("n", "<leader>relaod", ":luafile ~/.config/nvim/lua/init.lua", {noremap = false})