mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
new nvim config WIP
This commit is contained in:
parent
8163e330a0
commit
4c8fadee55
14 changed files with 463 additions and 0 deletions
21
nvim/lua/config/keymaps.lua
Normal file
21
nvim/lua/config/keymaps.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
-- Keep cursor centered while navigating document
|
||||
vim.keymap.set("n", "<C-U>", "<C-U>zz", { silent = true })
|
||||
vim.keymap.set("n", "<C-D>", "<C-D>zz", { silent = true })
|
||||
|
||||
-- Remap Ctrl + J/K/H/L to navigate between windows
|
||||
vim.keymap.set('n', '<C-j>', '<C-w>j', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w>k', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<C-h>', '<C-w>h', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<C-l>', '<C-w>l', { noremap = true, silent = true })
|
||||
|
||||
vim.keymap.set('n', '<C-Right>', ':vertical resize +10<CR>', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<C-Left>', ':vertical resize -10<CR>', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<C-Up>', ':horizontal resize +10<CR>', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<C-Down>', ':horizontal resize -10<CR>', { noremap = true, silent = true })
|
||||
|
||||
-- Remap Shift + H/L to switch between buffers
|
||||
vim.keymap.set('n', '<S-h>', ':bprevious<CR>', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<S-l>', ':bnext<CR>', { noremap = true, silent = true })
|
||||
|
||||
vim.keymap.set("v", "<", "<gv")
|
||||
vim.keymap.set("v", ">", ">gv")
|
||||
35
nvim/lua/config/lazy.lua
Normal file
35
nvim/lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = false },
|
||||
})
|
||||
31
nvim/lua/config/options.lua
Normal file
31
nvim/lua/config/options.lua
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
vim.o.clipboard = "unnamedplus"
|
||||
vim.g.autoformat = false
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.cursorline = true
|
||||
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.softtabstop = 2
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = false
|
||||
vim.opt.incsearch = false
|
||||
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.o.termguicolors = false
|
||||
vim.opt.guicursor = "n-v-c:block,i:block,r:block"
|
||||
vim.opt.fillchars = { eob = " " }
|
||||
|
||||
vim.cmd([[
|
||||
autocmd FileType python,haskell,c,cpp setlocal tabstop=4 shiftwidth=4 softtabstop=4
|
||||
]])
|
||||
|
||||
vim.cmd([[
|
||||
au BufRead,BufNewFile *.purs set filetype=purescript
|
||||
]])
|
||||
Loading…
Add table
Add a link
Reference in a new issue