feat: desktop config as base
This commit is contained in:
parent
d589775634
commit
7dba0b18be
34 changed files with 1148 additions and 890 deletions
6
nvim/.luarc.json
Normal file
6
nvim/.luarc.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||
"Lua.workspace.library": [
|
||||
"${3rd}/luassert/library"
|
||||
]
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
require("settings.options")
|
||||
require("settings.plugins")
|
||||
require("settings.options")
|
||||
require("settings.cmp")
|
||||
require("settings.lsp")
|
||||
require("settings.devicons")
|
||||
|
|
@ -25,8 +25,3 @@ require("telescope").load_extension("fzy_native")
|
|||
require("impatient").enable_profile()
|
||||
require("nightfox")
|
||||
require('Comment').setup()
|
||||
-- require('vgit').setup()
|
||||
|
||||
-- vim.o.updatetime = 3000
|
||||
-- vim.o.incsearch = false
|
||||
-- vim.wo.signcolumn = 'yes'
|
||||
|
|
|
|||
85
nvim/installer.sh
Normal file
85
nvim/installer.sh
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
#!/bin/sh
|
||||
# Standalone installer for Unixs
|
||||
# Original version is created by shoma2da
|
||||
# https://github.com/shoma2da/neobundle_installer
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "You must specify the installation directory!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Convert the installation directory to absolute path
|
||||
case $1 in
|
||||
/*) PLUGIN_DIR=$1;;
|
||||
*) PLUGIN_DIR=$PWD/$1;;
|
||||
esac
|
||||
INSTALL_DIR="${PLUGIN_DIR}/repos/github.com/Shougo/dein.vim"
|
||||
echo "Install to \"$INSTALL_DIR\"..."
|
||||
if [ -e "$INSTALL_DIR" ]; then
|
||||
echo "\"$INSTALL_DIR\" already exists!"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# check git command
|
||||
type git || {
|
||||
echo 'Please install git or update your path to include the git executable!'
|
||||
exit 1
|
||||
}
|
||||
echo ""
|
||||
|
||||
# make plugin dir and fetch dein
|
||||
if ! [ -e "$INSTALL_DIR" ]; then
|
||||
echo "Begin fetching dein..."
|
||||
mkdir -p "$PLUGIN_DIR"
|
||||
git clone --depth=1 https://github.com/Shougo/dein.vim "$INSTALL_DIR"
|
||||
echo "Done."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# write initial setting for .vimrc
|
||||
echo "Please add the following settings for dein to the top of your vimrc (Vim) or init.vim (NeoVim) file:"
|
||||
{
|
||||
echo ""
|
||||
echo ""
|
||||
echo "\"dein Scripts-----------------------------"
|
||||
echo "if &compatible"
|
||||
echo " set nocompatible \" Be iMproved"
|
||||
echo "endif"
|
||||
echo ""
|
||||
echo "\" Required:"
|
||||
echo "set runtimepath+=$INSTALL_DIR"
|
||||
echo ""
|
||||
echo "\" Required:"
|
||||
echo "call dein#begin('$PLUGIN_DIR')"
|
||||
echo ""
|
||||
echo "\" Let dein manage dein"
|
||||
echo "\" Required:"
|
||||
echo "call dein#add('$INSTALL_DIR')"
|
||||
echo ""
|
||||
echo "\" Add or remove your plugins here like this:"
|
||||
echo "\"call dein#add('Shougo/neosnippet.vim')"
|
||||
echo "\"call dein#add('Shougo/neosnippet-snippets')"
|
||||
echo ""
|
||||
echo "\" Required:"
|
||||
echo "call dein#end()"
|
||||
echo ""
|
||||
echo "\" Required:"
|
||||
echo "filetype plugin indent on"
|
||||
echo "syntax enable"
|
||||
echo ""
|
||||
echo "\" If you want to install not installed plugins on startup."
|
||||
echo "\"if dein#check_install()"
|
||||
echo "\" call dein#install()"
|
||||
echo "\"endif"
|
||||
echo ""
|
||||
echo "\"End dein Scripts-------------------------"
|
||||
echo ""
|
||||
echo ""
|
||||
}
|
||||
|
||||
echo "Done."
|
||||
|
||||
echo "Complete setup dein!"
|
||||
|
|
@ -1,19 +1,13 @@
|
|||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local term_opts = { silent = true }
|
||||
|
||||
-- Shorten function name
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
--vim.lsp.handlers["textDocument/codeAction"] = require'lspactions'.codeaction
|
||||
--vim.cmd [[ nnoremap <leader>af :lua require'lspactions'.code_action()<CR> ]]
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
-- space leader
|
||||
vim.g.mapleader = " "
|
||||
keymap("n", "<Space>", "<Nop>", { silent = true, noremap = false })
|
||||
|
||||
-- keymap('n', '<Space>', '<Nop>', { noremap = true, silent = true })
|
||||
-- keymap('n', '<Space>', '<leader>', { noremap = true, silent = true })
|
||||
-- keymap("n", "<Space>", "<Leader>", opts)
|
||||
-- keymap("n", "<M-CR>", ":CodeActionMenu<CR>", opts)
|
||||
keymap("n", "<C-f>", "<cmd>TroubleToggle<CR>", term_opts)
|
||||
--keymap("n", "<C-b>", ':lua require("vgit").buffer_stage()<CR>', opts)
|
||||
-- debug
|
||||
keymap("n", "<F5>", ':lua require("dap").toggle_breakpoint()<CR>', opts)
|
||||
keymap("n", "<F6>", ':lua require("dap").step_over()<CR>', opts)
|
||||
keymap("n", "<F7>", ':lua require("dap").step_into()<CR>', opts)
|
||||
|
|
@ -21,23 +15,41 @@ keymap("n", "<F8>", ':lua require("dap").continue()<CR> :lua require("dapui").to
|
|||
keymap("n", "<F9>", ':lua require("dap").continue()<CR>', opts)
|
||||
keymap("n", "<F10>", ':lua require("dap").close()<CR> :lua require("dapui").toggle()<CR>', opts)
|
||||
|
||||
-- file tree
|
||||
keymap("n", "t", ':lua require("nvim-tree").toggle()<CR>', opts)
|
||||
keymap("n", "f", ':lua require("nvim-tree").focus()<CR>', opts)
|
||||
|
||||
-- tab switching
|
||||
keymap("n", "<F1>", ":BufferPrev<CR>", opts)
|
||||
keymap("n", "<F2>", ":BufferNext<CR>", opts)
|
||||
|
||||
-- formatting
|
||||
keymap("n", "<F4>", ":lua vim.lsp.buf.format { async = true }<CR>", opts)
|
||||
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "ff", builtin.find_files, {})
|
||||
vim.keymap.set("n", "fg", builtin.live_grep, {})
|
||||
vim.keymap.set("n", "fb", builtin.buffers, {})
|
||||
vim.keymap.set("n", "fh", builtin.help_tags, {})
|
||||
-- telescope
|
||||
keymap("n", "ff", ":lua builtin.find_files", {})
|
||||
keymap("n", "fg", ":lua builtin.live_grep", {})
|
||||
keymap("n", "fb", ":lua builtin.buffers", {})
|
||||
keymap("n", "fh", ":lua builtin.help_tags", {})
|
||||
|
||||
-- trouble
|
||||
keymap("n", "<C-f>", "<cmd>TroubleToggle<CR>", term_opts)
|
||||
require("trouble").setup {
|
||||
action_keys = {
|
||||
--remove the fucking stupid keymap amk
|
||||
open_tab = {}
|
||||
}
|
||||
}
|
||||
|
||||
-- LSP
|
||||
local on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
local opts = { noremap = true, silent = true, buffer=bufnr }
|
||||
keymap("n", "<leader>h", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
keymap("n", "<leader>j", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
keymap("n", "<leader>k", "<Cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
keymap("n", "<leader>l", "<Cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
keymap("n", "<leader>;", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
keymap("n", "<leader>u", "<Cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
keymap("n", "<leader>g", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -19,39 +19,18 @@ require("mason-lspconfig").setup({
|
|||
"html", -- html
|
||||
"clangd", -- cpp / c
|
||||
"tsserver", -- python
|
||||
"texlab", -- latex
|
||||
"sumneko_lua", -- lua
|
||||
"pyright", -- python
|
||||
"rust_analyzer", -- rust
|
||||
"jdtls", -- jdtls
|
||||
"cmake", -- cmake
|
||||
"bashls", -- shell
|
||||
"ansiblels", -- ansible
|
||||
-- "omnisharp", -- dotnot
|
||||
-- "hls", -- haskel
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
local opts = { noremap = true, silent = true, buffer=bufnr }
|
||||
vim.keymap.set("n", "<leader>h", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>j", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>k", "<Cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>l", "<Cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>;", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>u", "<Cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>g", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(server_name) -- default handler (optional)
|
||||
require("lspconfig")[server_name].setup({
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ local options = {
|
|||
mouse = "n",
|
||||
fileencoding = "utf-8",
|
||||
relativenumber = true,
|
||||
cursorline = false,
|
||||
number = true,
|
||||
cursorline = false,
|
||||
number = true,
|
||||
smartindent = true,
|
||||
smartcase = true,
|
||||
showmode = true,
|
||||
|
|
@ -20,15 +20,12 @@ local options = {
|
|||
tabstop = 2, -- insert 2 spaces for a tab
|
||||
scrolloff = 8, -- is one of my fav
|
||||
sidescrolloff = 8,
|
||||
spell = false,
|
||||
syntax = "off",
|
||||
spell = true,
|
||||
syntax = "off",
|
||||
spelllang = "en_us",
|
||||
mousemodel = "popup_setpos",
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<Space>", "<Nop>", { silent = true, remap = false })
|
||||
vim.g.mapleader = " "
|
||||
|
||||
--vim.opt.shortmess:append "c"
|
||||
|
||||
for k, v in pairs(options) do
|
||||
|
|
|
|||
|
|
@ -17,6 +17,32 @@ local file_pattern = "*.tex"
|
|||
------------------------------------------------- boilerplate end
|
||||
-- snippers go here:
|
||||
|
||||
local formSnippet = s(
|
||||
"form-",
|
||||
fmt(
|
||||
[[
|
||||
\, \newline
|
||||
\large \textcolor{{purple}}{{\( {1} \)}}\newline
|
||||
\, \newline
|
||||
\normalsize Legend: \newline
|
||||
\begin{{itemize}}
|
||||
\item {2}
|
||||
\item {3}
|
||||
\item {4}
|
||||
\item {5}
|
||||
\end{{itemize}}
|
||||
]],
|
||||
{
|
||||
i(1, "formula"),
|
||||
i(2, "item 1"),
|
||||
i(3, "item 2"),
|
||||
i(4, "item 3"),
|
||||
i(5, "item 4"),
|
||||
}
|
||||
)
|
||||
)
|
||||
table.insert(snippets, formSnippet)
|
||||
|
||||
local listSnippet = s(
|
||||
"list-",
|
||||
fmt(
|
||||
|
|
@ -140,12 +166,14 @@ local minipgSnippet = s(
|
|||
[[
|
||||
\minipg{{
|
||||
{1}
|
||||
}}{{{2}}}[{3}]
|
||||
}}{{
|
||||
{2}
|
||||
}}[{3}]
|
||||
]],
|
||||
{
|
||||
i(1, "data..."),
|
||||
rep(1),
|
||||
i(2, "0.4,0.4"),
|
||||
i(2, "data..."),
|
||||
i(3, "0.25,0.25"),
|
||||
}
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue