chg: Move most of the config to lua
This commit is contained in:
parent
7993fef918
commit
f9369c20aa
16 changed files with 205 additions and 264 deletions
|
@ -1,11 +1,42 @@
|
|||
-- Load old vimrc first
|
||||
local vimrc = vim.fn.stdpath("config") .. "/vimrc.vim"
|
||||
vim.cmd.source(vimrc)
|
||||
local set = vim.opt
|
||||
|
||||
-- Load plugins using vim-plug
|
||||
-- Turn on numbers
|
||||
set.number = true
|
||||
-- Turn off line wrapping
|
||||
set.wrap = false
|
||||
-- Disable cmdline from bottom
|
||||
set.cmdheight = 0
|
||||
-- Ignore case while searching except when the search term contains capital letters
|
||||
set.ignorecase = true
|
||||
set.smartcase = true
|
||||
-- Use 4 spaces and properly adjust them for files using TAB
|
||||
set.tabstop = 4
|
||||
set.shiftwidth = 4
|
||||
set.softtabstop = 4
|
||||
set.expandtab = true
|
||||
-- Show LSP signs in the number column
|
||||
set.signcolumn = 'number'
|
||||
-- Turn on spell checking
|
||||
set.spell = true
|
||||
-- Enable mouse support
|
||||
set.mouse = 'n'
|
||||
-- Enable programming dictionary
|
||||
set.spelllang = { "en", "programming" }
|
||||
-- Use ctrl-[hjkl] to select the active split
|
||||
|
||||
-- Disable unused plugins
|
||||
vim.g.loaded_perl_provider = 0
|
||||
vim.g.loaded_node_provider = 0
|
||||
vim.g.loaded_ruby_provider = 0
|
||||
|
||||
-- Load UltiSnips snippets from custom-snippets directory
|
||||
vim.g.UltiSnipsSnippetDirectories = { "custom-snippets", "UltiSnips" }
|
||||
|
||||
-- Load keymaps
|
||||
local keymaps = vim.fn.stdpath("config") .. "/keymaps.vim"
|
||||
vim.cmd.source(keymaps)
|
||||
|
||||
-- Load plugins using paq-nvim
|
||||
local paq = vim.fn.stdpath("config") .. "/paq.lua"
|
||||
vim.cmd.source(paq)
|
||||
|
||||
-- Default settings for comment plugin
|
||||
require('Comment').setup()
|
||||
|
||||
|
|
32
laptop/keymaps.vim
Normal file
32
laptop/keymaps.vim
Normal file
|
@ -0,0 +1,32 @@
|
|||
" 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>
|
||||
|
|
@ -59,6 +59,6 @@ bootstrap_paq {
|
|||
"lervag/vimtex",
|
||||
-- Formatter
|
||||
"stevearc/conform.nvim",
|
||||
-- For Searching
|
||||
"junegunn/fzf.vim",
|
||||
"kylechui/nvim-surround",
|
||||
}
|
||||
|
|
8
laptop/plugin/misc.lua
Normal file
8
laptop/plugin/misc.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
-- This file lists all the plugins that need to be initiated to default setup
|
||||
|
||||
-- Default settings for comment plugin
|
||||
require("Comment").setup()
|
||||
|
||||
-- Default settings for nvim-surround
|
||||
require("nvim-surround").setup()
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
if ! &diff
|
||||
let g:suda_smart_edit = 1
|
||||
endif
|
||||
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
" Disable netrw for nvim-tree to work
|
||||
" let loaded_netrw = 1
|
||||
" let loaded_netrwPlugin = 1
|
||||
|
||||
" Turn on numbers
|
||||
set number
|
||||
|
||||
" Turn off line wrapping
|
||||
set nowrap
|
||||
|
||||
" Turn on syntax highlighting
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
|
||||
" Disable cmdline from bottom
|
||||
set cmdheight=0
|
||||
|
||||
" Display as much of a line as possible instead of just showing @
|
||||
set display+=lastline
|
||||
|
||||
" Ignore case while searching except when the search term contains capital letters
|
||||
set ignorecase
|
||||
set smartcase
|
||||
|
||||
" Use 4 spaces for tabs and properly adjust them for files using TAB
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set expandtab
|
||||
|
||||
" Needed for group colors to work in nvim-tree
|
||||
set termguicolors
|
||||
|
||||
" Show LSP signs in the number column
|
||||
set signcolumn=number
|
||||
|
||||
" Turn on spell checking
|
||||
set spell
|
||||
|
||||
" Enable mouse support
|
||||
set mouse=n
|
||||
|
||||
" Set K to hover
|
||||
command -nargs=+ LspHover lua vim.lsp.buf.hover()
|
||||
set keywordprg=:LspHover
|
||||
|
||||
" Enable programming dictionary
|
||||
set spelllang=en,programming
|
||||
|
||||
" 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>
|
||||
|
||||
" Disable unused plugins
|
||||
let g:loaded_perl_provider=0
|
||||
let g:loaded_node_provider=0
|
||||
let g:loaded_ruby_provider=0
|
||||
|
||||
" 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>
|
||||
|
||||
" Load UltiSnips snippets from custom-snippets
|
||||
let g:UltiSnipsSnippetDirectories=["custom-snippets", "UltiSnips"]
|
||||
|
||||
" Find files using fzf by ,f
|
||||
nnoremap <leader>f :Files<CR>
|
||||
|
|
@ -1,13 +1,39 @@
|
|||
-- Load old vimrc first
|
||||
local vimrc = vim.fn.stdpath("config") .. "/vimrc.vim"
|
||||
vim.cmd.source(vimrc)
|
||||
local set = vim.opt
|
||||
|
||||
-- Turn on numbers
|
||||
set.number = true
|
||||
-- Turn off line wrapping
|
||||
set.wrap = false
|
||||
-- Disable cmdline from bottom
|
||||
set.cmdheight = 0
|
||||
-- Ignore case while searching except when the search term contains capital letters
|
||||
set.ignorecase = true
|
||||
set.smartcase = true
|
||||
-- Use 4 spaces and properly adjust them for files using TAB
|
||||
set.tabstop = 4
|
||||
set.shiftwidth = 4
|
||||
set.softtabstop = 4
|
||||
set.expandtab = true
|
||||
-- Show LSP signs in the number column
|
||||
set.signcolumn = 'number'
|
||||
-- Turn on spell checking
|
||||
set.spell = true
|
||||
-- Enable mouse support
|
||||
set.mouse = 'n'
|
||||
-- Enable programming dictionary
|
||||
set.spelllang = { "en", "programming" }
|
||||
-- Use ctrl-[hjkl] to select the active split
|
||||
|
||||
-- Disable unused plugins
|
||||
vim.g.loaded_perl_provider = 0
|
||||
vim.g.loaded_node_provider = 0
|
||||
vim.g.loaded_ruby_provider = 0
|
||||
|
||||
-- Load keymaps
|
||||
local keymaps = vim.fn.stdpath("config") .. "/keymaps.vim"
|
||||
vim.cmd.source(keymaps)
|
||||
|
||||
-- Load plugins using paq-nvim
|
||||
local paq = vim.fn.stdpath("config") .. "/paq.lua"
|
||||
vim.cmd.source(paq)
|
||||
|
||||
-- Default settings for comment plugin
|
||||
require('Comment').setup()
|
||||
|
||||
-- Default settings for autopairs plugin
|
||||
require('nvim-autopairs').setup()
|
||||
|
|
17
server/keymaps.vim
Normal file
17
server/keymaps.vim
Normal file
|
@ -0,0 +1,17 @@
|
|||
" 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>
|
||||
|
|
@ -33,14 +33,6 @@ bootstrap_paq {
|
|||
"lambdalisue/suda.vim",
|
||||
-- Auto toggle for number mode when vim isn't focused
|
||||
"sitiom/nvim-numbertoggle",
|
||||
-- LSP related plugins
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"hrsh7th/nvim-cmp", -- For LSP completion
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
-- Support programming terms
|
||||
{ "psliwka/vim-dirtytalk", build = ':let &rtp = &rtp | DirtytalkUpdate' },
|
||||
-- vim-moonfly theme
|
||||
|
@ -51,5 +43,6 @@ bootstrap_paq {
|
|||
"isobit/vim-caddyfile",
|
||||
-- Syntax highlighting for Fish scripts
|
||||
"khaveesh/vim-fish-syntax",
|
||||
"kylechui/nvim-surround",
|
||||
}
|
||||
|
||||
|
|
11
server/plugin/misc.lua
Normal file
11
server/plugin/misc.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
-- This file lists all the plugins that need to be initiated to default setup
|
||||
|
||||
-- Default settings for comment plugin
|
||||
require("Comment").setup()
|
||||
|
||||
-- Default settings for autopairs plugin
|
||||
require("nvim-autopairs").setup()
|
||||
|
||||
-- Default settings for nvim-surround
|
||||
require("nvim-surround").setup()
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
" Disable netrw for nvim-tree to work
|
||||
let loaded_netrw = 1
|
||||
let loaded_netrwPlugin = 1
|
||||
|
||||
" Turn on numbers
|
||||
set number
|
||||
|
||||
" Turn off line wrapping
|
||||
set nowrap
|
||||
|
||||
" Turn on syntax highlighting
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
|
||||
" Disable cmdline from bottom
|
||||
set cmdheight=0
|
||||
|
||||
" Display as much of a line as possible instead of just showing @
|
||||
set display+=lastline
|
||||
|
||||
" Ignore case while searching except when the search term contains capital
|
||||
" letters
|
||||
set ignorecase
|
||||
set smartcase
|
||||
|
||||
" Use 4 spaces for tabs and properly adjust them for files using TAB
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set expandtab
|
||||
|
||||
" Needed for group colors to work in nvim-tree
|
||||
set termguicolors
|
||||
|
||||
" Show LSP signs in the number column
|
||||
set signcolumn=number
|
||||
|
||||
" Turn on spell checking
|
||||
set spell
|
||||
|
||||
" Enable mouse support
|
||||
set mouse=n
|
||||
|
||||
" Enable automatic format on save, text change in normal mode and leaving
|
||||
" insert mode
|
||||
autocmd BufWritePre,TextChanged,InsertLeave <buffer> lua vim.lsp.buf.format()
|
||||
|
||||
" Set K to hover
|
||||
command -nargs=+ LspHover lua vim.lsp.buf.hover()
|
||||
set keywordprg=:LspHover
|
||||
|
||||
" Enable programming dictionary
|
||||
set spelllang=en,programming
|
||||
|
||||
" Disable unused plugins
|
||||
let g:loaded_perl_provider=0
|
||||
let g:loaded_node_provider=0
|
||||
let g:loaded_ruby_provider=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>
|
||||
|
41
vps/init.lua
41
vps/init.lua
|
@ -1,13 +1,38 @@
|
|||
-- Load old vimrc first
|
||||
local vimrc = vim.fn.stdpath("config") .. "/vimrc.vim"
|
||||
vim.cmd.source(vimrc)
|
||||
local set = vim.opt
|
||||
|
||||
-- Turn on numbers
|
||||
set.number = true
|
||||
-- Turn off line wrapping
|
||||
set.wrap = false
|
||||
-- Disable cmdline from bottom
|
||||
set.cmdheight = 0
|
||||
-- Ignore case while searching except when the search term contains capital letters
|
||||
set.ignorecase = true
|
||||
set.smartcase = true
|
||||
-- Use 4 spaces and properly adjust them for files using TAB
|
||||
set.tabstop = 4
|
||||
set.shiftwidth = 4
|
||||
set.softtabstop = 4
|
||||
set.expandtab = true
|
||||
-- Show LSP signs in the number column
|
||||
set.signcolumn = 'number'
|
||||
-- Turn on spell checking
|
||||
set.spell = true
|
||||
-- Enable mouse support
|
||||
set.mouse = 'n'
|
||||
-- Enable programming dictionary
|
||||
set.spelllang = { "en", "programming" }
|
||||
|
||||
-- Disable unused plugins
|
||||
vim.g.loaded_perl_provider = 0
|
||||
vim.g.loaded_node_provider = 0
|
||||
vim.g.loaded_ruby_provider = 0
|
||||
|
||||
-- Load keymaps
|
||||
local keymaps = vim.fn.stdpath("config") .. "/keymaps.vim"
|
||||
vim.cmd.source(keymaps)
|
||||
|
||||
-- Load plugins using paq-nvim
|
||||
local paq = vim.fn.stdpath("config") .. "/paq.lua"
|
||||
vim.cmd.source(paq)
|
||||
|
||||
-- Default settings for comment plugin
|
||||
require('Comment').setup()
|
||||
|
||||
-- Default settings for autopairs plugin
|
||||
require('nvim-autopairs').setup()
|
||||
|
|
17
vps/keymaps.vim
Normal file
17
vps/keymaps.vim
Normal file
|
@ -0,0 +1,17 @@
|
|||
" 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>
|
||||
|
|
@ -56,5 +56,6 @@ bootstrap_paq {
|
|||
"isobit/vim-caddyfile",
|
||||
-- Syntax highlighting for Fish scripts
|
||||
"khaveesh/vim-fish-syntax",
|
||||
"kylechui/nvim-surround",
|
||||
}
|
||||
|
||||
|
|
11
vps/plugin/misc.lua
Normal file
11
vps/plugin/misc.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
-- This file lists all the plugins that need to be initiated to default setup
|
||||
|
||||
-- Default settings for comment plugin
|
||||
require("Comment").setup()
|
||||
|
||||
-- Default settings for autopairs plugin
|
||||
require("nvim-autopairs").setup()
|
||||
|
||||
-- Default settings for nvim-surround
|
||||
require("nvim-surround").setup()
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
" Disable netrw for nvim-tree to work
|
||||
let loaded_netrw = 1
|
||||
let loaded_netrwPlugin = 1
|
||||
|
||||
" Turn on numbers
|
||||
set number
|
||||
|
||||
" Turn off line wrapping
|
||||
set nowrap
|
||||
|
||||
" Turn on syntax highlighting
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
|
||||
" Disable cmdline from bottom
|
||||
set cmdheight=0
|
||||
|
||||
" Display as much of a line as possible instead of just showing @
|
||||
set display+=lastline
|
||||
|
||||
" Ignore case while searching except when the search term contains capital
|
||||
" letters
|
||||
set ignorecase
|
||||
set smartcase
|
||||
|
||||
" Use 4 spaces for tabs and properly adjust them for files using TAB
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set expandtab
|
||||
|
||||
" Needed for group colors to work in nvim-tree
|
||||
set termguicolors
|
||||
|
||||
" Show LSP signs in the number column
|
||||
set signcolumn=number
|
||||
|
||||
" Turn on spell checking
|
||||
set spell
|
||||
|
||||
" Enable mouse support
|
||||
set mouse=n
|
||||
|
||||
" Enable automatic format on save, text change in normal mode and leaving
|
||||
" insert mode
|
||||
autocmd BufWritePre,TextChanged,InsertLeave <buffer> lua vim.lsp.buf.format()
|
||||
|
||||
" Set K to hover
|
||||
command -nargs=+ LspHover lua vim.lsp.buf.hover()
|
||||
set keywordprg=:LspHover
|
||||
|
||||
" Enable programming dictionary
|
||||
set spelllang=en,programming
|
||||
|
||||
" Disable unused plugins
|
||||
let g:loaded_perl_provider=0
|
||||
let g:loaded_node_provider=0
|
||||
let g:loaded_ruby_provider=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>
|
||||
|
Loading…
Reference in a new issue