chg: Move almost every setting to lua

This commit is contained in:
Sayantan Santra 2024-03-20 20:48:32 -05:00
parent ec8547fe83
commit 45c537c675
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
9 changed files with 83 additions and 77 deletions

View file

@ -33,7 +33,7 @@ vim.g.loaded_ruby_provider = 0
vim.g.UltiSnipsSnippetDirectories = { "custom-snippets", "UltiSnips" }
-- Load keymaps
local keymaps = vim.fn.stdpath("config") .. "/keymaps.vim"
local keymaps = vim.fn.stdpath("config") .. "/keymaps.lua"
vim.cmd.source(keymaps)
-- Load plugins using paq-nvim

35
laptop/keymaps.lua Normal file
View file

@ -0,0 +1,35 @@
-- This file lists all the global keymaps
-- Change the leader and localleader
vim.g.mapleader = ','
vim.g.maplocalleader = ';'
-- Set K to hover
vim.cmd[[command -nargs=+ LspHover lua vim.lsp.buf.hover()]]
vim.opt.keywordprg = ":LspHover"
-- Use ctrl-[hjkl] to select the active split!
vim.keymap.set('n', '<c-k>', ":wincmd k<cr>", { silent = true })
vim.keymap.set('n', '<c-j>', ":wincmd j<cr>", { silent = true })
vim.keymap.set('n', '<c-h>', ":wincmd h<cr>", { silent = true })
vim.keymap.set('n', '<c-l>', ":wincmd l<cr>", { silent = true })
-- Use ,dd for deleting without putting into buffer
vim.keymap.set({ 'v', 'n' }, '<leader>d', '"_d', { remap = false })
vim.keymap.set('n', '<leader>D', '"_D', { remap = false })
vim.keymap.set('n', '<leader>x', '"_x', { remap = false })
-- Insert a newline in normal mode by ,o
vim.keymap.set('n', '<leader>o', "o<Esc>k", { remap = false })
vim.keymap.set('n', '<leader>O', "O<Esc>j", { remap = false })
-- Use ,u for redo
vim.keymap.set('n', '<leader>u', "<c-r>", { remap = false })
-- Find files using fzf by ,f
vim.keymap.set('n', '<leader>f', ":Files<cr>", { remap = false })
-- Move around buffers using ,j and ,k
vim.keymap.set('n', '<leader>k', ":bnext<cr>", { remap = false })
vim.keymap.set('n', '<leader>j', ":bprevious<cr>", { remap = false })

View file

@ -1,36 +0,0 @@
" This file lists all the global keymaps
" Set K to hover
command -nargs=+ LspHover lua vim.lsp.buf.hover()
set keywordprg=:LspHover
" Use ctrl-[hjkl] to select the active split!
nmap <silent> <c-k> :wincmd k<CR>
nmap <silent> <c-j> :wincmd j<CR>
nmap <silent> <c-h> :wincmd h<CR>
nmap <silent> <c-l> :wincmd l<CR>
" Change the leader and localleader
let mapleader=","
let maplocalleader=';'
" Use ,dd for deleting without putting into buffer
nnoremap <leader>d "_d
nnoremap <leader>D "_D
nnoremap <leader>x "_x
vnoremap <leader>d "_d
" Insert a newline in normal mode by ,o
nnoremap <leader>o o<Esc>k
nnoremap <leader>O O<Esc>j
" Use ,u for redo
nnoremap <leader>u <c-r>
" Find files using fzf by ,f
nnoremap <leader>f :Files<CR>
" Move around buffers using ,j and ,k
nnoremap <leader>k :bnext<CR>
nnoremap <leader>k :bprevious<CR>

View file

@ -27,7 +27,7 @@ vim.g.loaded_node_provider = 0
vim.g.loaded_ruby_provider = 0
-- Load keymaps
local keymaps = vim.fn.stdpath("config") .. "/keymaps.vim"
local keymaps = vim.fn.stdpath("config") .. "/keymaps.lua"
vim.cmd.source(keymaps)
-- Load plugins using paq-nvim

23
server/keymaps.lua Normal file
View file

@ -0,0 +1,23 @@
-- This file lists all the global keymaps
-- Change the leader and localleader
vim.g.mapleader = ','
vim.g.maplocalleader = ';'
-- Use ,dd for deleting without putting into buffer
vim.keymap.set({ 'v', 'n' }, '<leader>d', '"_d', { remap = false })
vim.keymap.set('n', '<leader>D', '"_D', { remap = false })
vim.keymap.set('n', '<leader>x', '"_x', { remap = false })
-- Insert a newline in normal mode by ,o
vim.keymap.set('n', '<leader>o', "o<Esc>k", { remap = false })
vim.keymap.set('n', '<leader>O', "O<Esc>j", { remap = false })
-- Use ,u for redo
vim.keymap.set('n', '<leader>u', "<c-r>", { remap = false })
-- Move around buffers using ,j and ,k
vim.keymap.set('n', '<leader>k', ":bnext<cr>", { remap = false })
vim.keymap.set('n', '<leader>j', ":bprevious<cr>", { remap = false })

View file

@ -1,21 +0,0 @@
" Change the leader to a comma
let mapleader = ","
let g:mapleader = ","
" Use ,dd for deleting without putting into buffer
nnoremap <leader>d "_d
nnoremap <leader>D "_D
nnoremap <leader>x "_x
vnoremap <leader>d "_d
" Insert a newline in normal mode by ,o
nnoremap <Leader>o o<Esc>k
nnoremap <Leader>O O<Esc>j
" Use ,u for redo
nnoremap <Leader>u <c-r>
" Move around buffers using ,j and ,k
nnoremap <leader>k :bnext<CR>
nnoremap <leader>k :bprevious<CR>

View file

@ -27,7 +27,7 @@ vim.g.loaded_node_provider = 0
vim.g.loaded_ruby_provider = 0
-- Load keymaps
local keymaps = vim.fn.stdpath("config") .. "/keymaps.vim"
local keymaps = vim.fn.stdpath("config") .. "/keymaps.lua"
vim.cmd.source(keymaps)
-- Load plugins using paq-nvim

22
vps/keymaps.lua Normal file
View file

@ -0,0 +1,22 @@
-- This file lists all the global keymaps
-- Change the leader and localleader
vim.g.mapleader = ','
vim.g.maplocalleader = ';'
-- Use ,dd for deleting without putting into buffer
vim.keymap.set({ 'v', 'n' }, '<leader>d', '"_d', { remap = false })
vim.keymap.set('n', '<leader>D', '"_D', { remap = false })
vim.keymap.set('n', '<leader>x', '"_x', { remap = false })
-- Insert a newline in normal mode by ,o
vim.keymap.set('n', '<leader>o', "o<Esc>k", { remap = false })
vim.keymap.set('n', '<leader>O', "O<Esc>j", { remap = false })
-- Use ,u for redo
vim.keymap.set('n', '<leader>u', "<c-r>", { remap = false })
-- Move around buffers using ,j and ,k
vim.keymap.set('n', '<leader>k', ":bnext<cr>", { remap = false })
vim.keymap.set('n', '<leader>j', ":bprevious<cr>", { remap = false })

View file

@ -1,17 +0,0 @@
" Change the leader to a comma
let mapleader = ","
let g:mapleader = ","
" Use ,dd for deleting without putting into buffer
nnoremap <leader>d "_d
nnoremap <leader>D "_D
nnoremap <leader>x "_x
vnoremap <leader>d "_d
" Insert a newline in normal mode by ,o
nnoremap <Leader>o o<Esc>k
nnoremap <Leader>O O<Esc>j
" Use ,u for redo
nnoremap <Leader>u <c-r>