Compare commits

..

12 Commits

Author SHA1 Message Date
76bdd7b9fe use lazy.nvim to add plugins
vim-fugitive, telescope and nvim-lspconfig plugins added
2026-03-29 19:58:15 +05:30
a24380f314 add yaml, toml to batch comment rule 2026-03-07 15:17:26 +05:30
3394778b23 added scheme, rust, go comment bindings 2025-07-05 21:02:31 +05:30
fbf6e9929e disable mouse in nvim
Signed-off-by: Dhanus M Lal <dhanusmlal@gmail.com>
2025-03-22 21:51:15 +05:30
8eadabe7d8 added autocmd to remove terminal lineno
Signed-off-by: Dhanus M Lal <dhanusmlal@gmail.com>
2025-01-23 23:48:35 +05:30
Dhanus M Lal
a02af94bd2 updated nvim config 2024-09-10 10:19:24 +05:30
Dhanus M Lal
f667533913 bugfix 2024-07-17 10:06:49 +05:30
Dhanus M Lal
1e1163bfd5 changed exit from terminal binding 2024-07-17 10:03:37 +05:30
66e7b048a0 added terminal mode bindings (nvim)
Signed-off-by: Dhanus M Lal <dhanusmlal@gmail.com>
2024-07-12 09:43:02 +05:30
Dhanus M Lal
04521bddb2 updated config 2024-07-10 17:00:57 +05:30
8d22b74c44 added neovim config
Signed-off-by: Dhanus M Lal <dhanusmlal@gmail.com>
2024-07-09 22:34:52 +05:30
0c9c6182ce removed comment from tmux.conf
Signed-off-by: Dhanus M Lal <dhanusmlal@gmail.com>
2023-12-11 22:58:58 +05:30
8 changed files with 168 additions and 3 deletions

View File

@@ -13,6 +13,8 @@ alias ll='ls -alF'
alias la='ls -A' alias la='ls -A'
alias l='ls -CF' alias l='ls -CF'
alias vi='vim' alias vi='vim'
alias vim='nvim'
alias vi='nvim'
# PS1="[\[\e[01;32m\]\u@\h \[\e[00;33m\]\W\[\e[00m\]]\$ " # PS1="[\[\e[01;32m\]\u@\h \[\e[00;33m\]\W\[\e[00m\]]\$ "
PS1="[\[\e[00;33m\]\w\[\e[00m\]]\$ " PS1="[\[\e[00;33m\]\w\[\e[00m\]]\$ "
@@ -21,3 +23,4 @@ PS1="[\[\e[00;33m\]\w\[\e[00m\]]\$ "
# PS1='[\u@\h \W]\$ ' # PS1='[\u@\h \W]\$ '
PATH=$PATH:/home/dhanus/.myscripts:/home/dhanus/.local/bin:/home/dhanus/.myexes PATH=$PATH:/home/dhanus/.myscripts:/home/dhanus/.local/bin:/home/dhanus/.myexes
. "$HOME/.cargo/env"

1
nvim/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
lazy-lock.json

88
nvim/bindings.lua Normal file
View File

@@ -0,0 +1,88 @@
-- bindings
local function invert_hl ()
vim.opt.hlsearch = not vim.opt.hlsearch._value
end
local function launch_file_tree()
vim.cmd('20Lexplore')
end
-- Normal mode
vim.keymap.set('n', '<leader>l', '<c-w>l')
vim.keymap.set('n', '<leader>h', '<c-w>h')
vim.keymap.set('n', '<leader>j', '<c-w>j')
vim.keymap.set('n', '<leader>k', '<c-w>k')
vim.keymap.set('n', '<leader>sv', ':source $MYVIMRC<cr>')
vim.keymap.set('n', '<leader>ev', ':edit $MYVIMRC<cr>')
vim.keymap.set('n', '<leader>n', invert_hl)
vim.keymap.set('n', '<leader>.', ':bnext<cr>')
vim.keymap.set('n', '<leader>,', ':bprevious<cr>')
vim.keymap.set('n', '<leader>f', launch_file_tree)
-- Insert mode
vim.keymap.set('i', 'jk', '<esc>')
-- Terminal mode
vim.keymap.set('t', '<c-\\>', '<c-\\><c-n>')
-- Autocorrect
vim.cmd('inoreabbrev paht path')
vim.cmd('inoreabbrev taht that')
vim.cmd('inoreabbrev classificaton classification')
vim.cmd('inoreabbrev compnents components')
vim.cmd('inoreabbrev compnent component')
vim.cmd('inoreabbrev pythone python')
vim.cmd('inoreabbrev smaples samples')
vim.cmd('inoreabbrev sover solver')
vim.cmd('inoreabbrev souce source')
-- Autocmds
local common_group = vim.api.nvim_create_augroup('common', {clear = true})
local spec_group = vim.api.nvim_create_augroup('lang_spec', {clear = true})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "python", "make", "sh", "cmake", "yaml", "toml" },
callback = function(args)
vim.keymap.set('v', '<leader>#', ':normal 0i#<esc>', { buffer = args.buf })
end,
group = 'lang_spec',
desc = "comment multiple lines for python source file"
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "scheme" },
callback = function(args)
vim.keymap.set('v', '<leader>;', ':normal 0i;<esc>', { buffer = args.buf })
end,
group = 'lang_spec',
desc = "comment multiple lines for scheme source"
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { 'c', 'cpp', 'go', 'rust' },
callback = function(args)
vim.keymap.set('v', '<leader>//', ':normal 0i//<esc>', { buffer = args.buf })
end,
group = 'lang_spec',
desc = 'comment multiple lines for c/c++'
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { 'c', 'cpp', 'rust' },
callback = function(args)
vim.keymap.set('v', '<leader>/*', '<esc>`<i/*<esc>`>i*/<esc>', { buffer = args.buf })
end,
group = 'lang_spec',
desc = 'comment multiple lines for c/c++'
})
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function() vim.highlight.on_yank({ timeout = 1000 }) end,
group = 'common',
desc = "briefly highlight yanked text"
})
vim.api.nvim_command([[autocmd TermOpen * setlocal nonu]])
vim.api.nvim_command([[autocmd TermOpen * setlocal nornu]])

6
nvim/init.lua Normal file
View File

@@ -0,0 +1,6 @@
package.path = package.path .. ";/home/dhanus/.config/nvim/?.lua"
require('settings')
require('bindings')
require('packconf.lazy')

23
nvim/lua/plugins/init.lua Normal file
View File

@@ -0,0 +1,23 @@
return {
{
"tpope/vim-fugitive",
},
{
"nvim-telescope/telescope.nvim",
config = function()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>tf', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>gr', builtin.live_grep, { desc = 'Telescope live grep' })
vim.keymap.set('n', '<leader>tb', builtin.buffers, { desc = 'Telescope buffers' })
end
},
{
"neovim/nvim-lspconfig",
config = function()
vim.lsp.enable('rust_analyzer')
vim.lsp.enable('clangd')
vim.lsp.enable('lua_ls')
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
end
},
}

25
nvim/packconf/lazy.lua Normal file
View File

@@ -0,0 +1,25 @@
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)
require("lazy").setup({
spec = {
{import = "plugins"}
},
install = { colorscheme = { "habamax" } },
checker = { enabled = true },
})

22
nvim/settings.lua Normal file
View File

@@ -0,0 +1,22 @@
-- global settings
vim.g.mapleader = ' '
vim.cmd.colorscheme('habamax')
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 2
vim.opt.expandtab = true
vim.opt.hlsearch = false
vim.opt.autoindent = true
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.cursorline = true
vim.opt.mouse = ""
vim.opt.statusline = '%f %m %y %= C:%c L:%l/%L %p%%'
vim.g.netrw_banner = 0
vim.g.netrw_liststyle = 3

View File

@@ -20,6 +20,3 @@ set -g mode-keys vi
#set -g default-terminal "screen-256color" #set -g default-terminal "screen-256color"
#set -g status-bg black
#set -g status-fg white