From 8fbf7c2a9ce92b97941bff2c8b52c1d52d9834d2 Mon Sep 17 00:00:00 2001 From: cryxtalix Date: Sat, 9 May 2026 00:15:07 +0800 Subject: Update --- .config/nvim_old/ftplugin/c.lua | 12 ++++++++++++ .config/nvim_old/ftplugin/cpp.lua | 12 ++++++++++++ .config/nvim_old/ftplugin/html.lua | 12 ++++++++++++ .config/nvim_old/ftplugin/htmldjango.lua | 12 ++++++++++++ .config/nvim_old/ftplugin/json.lua | 12 ++++++++++++ .config/nvim_old/ftplugin/lua.lua | 14 ++++++++++++++ .config/nvim_old/ftplugin/make.lua | 12 ++++++++++++ .config/nvim_old/ftplugin/python.lua | 12 ++++++++++++ .config/nvim_old/ftplugin/rust.lua | 31 +++++++++++++++++++++++++++++++ .config/nvim_old/ftplugin/sh.lua | 12 ++++++++++++ .config/nvim_old/ftplugin/toml.lua | 12 ++++++++++++ .config/nvim_old/ftplugin/xml.lua | 12 ++++++++++++ 12 files changed, 165 insertions(+) create mode 100644 .config/nvim_old/ftplugin/c.lua create mode 100644 .config/nvim_old/ftplugin/cpp.lua create mode 100644 .config/nvim_old/ftplugin/html.lua create mode 100644 .config/nvim_old/ftplugin/htmldjango.lua create mode 100644 .config/nvim_old/ftplugin/json.lua create mode 100644 .config/nvim_old/ftplugin/lua.lua create mode 100644 .config/nvim_old/ftplugin/make.lua create mode 100644 .config/nvim_old/ftplugin/python.lua create mode 100644 .config/nvim_old/ftplugin/rust.lua create mode 100644 .config/nvim_old/ftplugin/sh.lua create mode 100644 .config/nvim_old/ftplugin/toml.lua create mode 100644 .config/nvim_old/ftplugin/xml.lua (limited to '.config/nvim_old/ftplugin') diff --git a/.config/nvim_old/ftplugin/c.lua b/.config/nvim_old/ftplugin/c.lua new file mode 100644 index 0000000..4514ab3 --- /dev/null +++ b/.config/nvim_old/ftplugin/c.lua @@ -0,0 +1,12 @@ +local indent_size = 8 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/cpp.lua b/.config/nvim_old/ftplugin/cpp.lua new file mode 100644 index 0000000..4514ab3 --- /dev/null +++ b/.config/nvim_old/ftplugin/cpp.lua @@ -0,0 +1,12 @@ +local indent_size = 8 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/html.lua b/.config/nvim_old/ftplugin/html.lua new file mode 100644 index 0000000..3fbcec4 --- /dev/null +++ b/.config/nvim_old/ftplugin/html.lua @@ -0,0 +1,12 @@ +local indent_size = 4 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/htmldjango.lua b/.config/nvim_old/ftplugin/htmldjango.lua new file mode 100644 index 0000000..3fbcec4 --- /dev/null +++ b/.config/nvim_old/ftplugin/htmldjango.lua @@ -0,0 +1,12 @@ +local indent_size = 4 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/json.lua b/.config/nvim_old/ftplugin/json.lua new file mode 100644 index 0000000..3fbcec4 --- /dev/null +++ b/.config/nvim_old/ftplugin/json.lua @@ -0,0 +1,12 @@ +local indent_size = 4 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/lua.lua b/.config/nvim_old/ftplugin/lua.lua new file mode 100644 index 0000000..275b1a9 --- /dev/null +++ b/.config/nvim_old/ftplugin/lua.lua @@ -0,0 +1,14 @@ +local indent_size = 2 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) + +-- Check http://vimcasts.org/episodes/tabs-and-spaces/ for more info on tabs and spaces diff --git a/.config/nvim_old/ftplugin/make.lua b/.config/nvim_old/ftplugin/make.lua new file mode 100644 index 0000000..2ad7f95 --- /dev/null +++ b/.config/nvim_old/ftplugin/make.lua @@ -0,0 +1,12 @@ +local indent_size = 8 +local use_tabs = true + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/python.lua b/.config/nvim_old/ftplugin/python.lua new file mode 100644 index 0000000..3fbcec4 --- /dev/null +++ b/.config/nvim_old/ftplugin/python.lua @@ -0,0 +1,12 @@ +local indent_size = 4 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/rust.lua b/.config/nvim_old/ftplugin/rust.lua new file mode 100644 index 0000000..029f0da --- /dev/null +++ b/.config/nvim_old/ftplugin/rust.lua @@ -0,0 +1,31 @@ +local indent_size = 4 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +local bufnr = vim.api.nvim_get_current_buf() +vim.keymap.set( + "n", + "a", + function() + vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping + -- or vim.lsp.buf.codeAction() if you don't want grouping. + end, + { silent = true, buffer = bufnr } +) +vim.keymap.set( + "n", + "K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions + function() + vim.cmd.RustLsp({'hover', 'actions'}) + end, + { silent = true, buffer = bufnr } +) + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/sh.lua b/.config/nvim_old/ftplugin/sh.lua new file mode 100644 index 0000000..4d8e3f2 --- /dev/null +++ b/.config/nvim_old/ftplugin/sh.lua @@ -0,0 +1,12 @@ +local indent_size = 2 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/toml.lua b/.config/nvim_old/ftplugin/toml.lua new file mode 100644 index 0000000..3fbcec4 --- /dev/null +++ b/.config/nvim_old/ftplugin/toml.lua @@ -0,0 +1,12 @@ +local indent_size = 4 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) diff --git a/.config/nvim_old/ftplugin/xml.lua b/.config/nvim_old/ftplugin/xml.lua new file mode 100644 index 0000000..4d8e3f2 --- /dev/null +++ b/.config/nvim_old/ftplugin/xml.lua @@ -0,0 +1,12 @@ +local indent_size = 2 +local use_tabs = false + +local settings = string.format("setlocal softtabstop=%s tabstop=%s shiftwidth=%s", indent_size, indent_size, indent_size) + +if use_tabs == true then + settings = settings .. " noexpandtab" +else + settings = settings .. " expandtab" +end + +vim.cmd(settings) -- cgit