Compare commits

..

10 Commits

Author SHA1 Message Date
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
5 changed files with 117 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"

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" },
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' },
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]])

4
nvim/init.lua Normal file
View File

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

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