From 1302056eddd9a69ea2d0ffdf8bedd8582fb5a907 Mon Sep 17 00:00:00 2001 From: cryxtalix Date: Fri, 8 May 2026 03:43:16 +0800 Subject: Update --- .config/nvim_pack/ftplugin/c.lua | 12 ++++++++++++ .config/nvim_pack/ftplugin/json.lua | 12 ++++++++++++ .config/nvim_pack/ftplugin/lua.lua | 14 ++++++++++++++ .config/nvim_pack/ftplugin/make.lua | 12 ++++++++++++ .config/nvim_pack/ftplugin/python.lua | 12 ++++++++++++ .config/nvim_pack/ftplugin/rust.lua | 31 +++++++++++++++++++++++++++++++ .config/nvim_pack/ftplugin/sh.lua | 12 ++++++++++++ .config/nvim_pack/ftplugin/xml.lua | 12 ++++++++++++ 8 files changed, 117 insertions(+) create mode 100644 .config/nvim_pack/ftplugin/c.lua create mode 100644 .config/nvim_pack/ftplugin/json.lua create mode 100644 .config/nvim_pack/ftplugin/lua.lua create mode 100644 .config/nvim_pack/ftplugin/make.lua create mode 100644 .config/nvim_pack/ftplugin/python.lua create mode 100644 .config/nvim_pack/ftplugin/rust.lua create mode 100644 .config/nvim_pack/ftplugin/sh.lua create mode 100644 .config/nvim_pack/ftplugin/xml.lua (limited to '.config/nvim_pack/ftplugin') diff --git a/.config/nvim_pack/ftplugin/c.lua b/.config/nvim_pack/ftplugin/c.lua new file mode 100644 index 0000000..4514ab3 --- /dev/null +++ b/.config/nvim_pack/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_pack/ftplugin/json.lua b/.config/nvim_pack/ftplugin/json.lua new file mode 100644 index 0000000..3fbcec4 --- /dev/null +++ b/.config/nvim_pack/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_pack/ftplugin/lua.lua b/.config/nvim_pack/ftplugin/lua.lua new file mode 100644 index 0000000..275b1a9 --- /dev/null +++ b/.config/nvim_pack/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_pack/ftplugin/make.lua b/.config/nvim_pack/ftplugin/make.lua new file mode 100644 index 0000000..2ad7f95 --- /dev/null +++ b/.config/nvim_pack/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_pack/ftplugin/python.lua b/.config/nvim_pack/ftplugin/python.lua new file mode 100644 index 0000000..3fbcec4 --- /dev/null +++ b/.config/nvim_pack/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_pack/ftplugin/rust.lua b/.config/nvim_pack/ftplugin/rust.lua new file mode 100644 index 0000000..029f0da --- /dev/null +++ b/.config/nvim_pack/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_pack/ftplugin/sh.lua b/.config/nvim_pack/ftplugin/sh.lua new file mode 100644 index 0000000..4d8e3f2 --- /dev/null +++ b/.config/nvim_pack/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_pack/ftplugin/xml.lua b/.config/nvim_pack/ftplugin/xml.lua new file mode 100644 index 0000000..4d8e3f2 --- /dev/null +++ b/.config/nvim_pack/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