Skip to content

Commit

Permalink
perf(filetype): update filetype config
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesChiuGit committed Jul 7, 2024
1 parent 6d2cd84 commit 26123d2
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 59 deletions.
16 changes: 9 additions & 7 deletions after/ftplugin/c.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
vim.opt_local.commentstring = "//%s"
vim.opt_local.autoindent = true
vim.opt_local.smartindent = true
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.tabstop = 2
vim.opt_local.expandtab = true
local set = vim.opt_local

set.commentstring = "//%s"
set.autoindent = true
set.smartindent = true
set.shiftwidth = 2
set.softtabstop = 2
set.tabstop = 2
set.expandtab = true
12 changes: 7 additions & 5 deletions after/ftplugin/cpp.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
vim.opt_local.commentstring = "//%s"
vim.opt_local.expandtab = true
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.tabstop = 2
local set = vim.opt_local

set.commentstring = "//%s"
set.expandtab = true
set.shiftwidth = 2
set.softtabstop = 2
set.tabstop = 2
12 changes: 7 additions & 5 deletions after/ftplugin/dockerfile.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
vim.opt_local.cindent = false
vim.opt_local.expandtab = false
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.tabstop = 2
local set = vim.opt_local

set.cindent = false
set.expandtab = false
set.shiftwidth = 2
set.softtabstop = 2
set.tabstop = 2
12 changes: 7 additions & 5 deletions after/ftplugin/go.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
vim.opt_local.commentstring = "//%s"
vim.opt_local.expandtab = false
vim.opt_local.shiftwidth = 4
vim.opt_local.softtabstop = 4
vim.opt_local.tabstop = 4
local set = vim.opt_local

set.commentstring = "//%s"
set.expandtab = false
set.shiftwidth = 4
set.softtabstop = 4
set.tabstop = 4
18 changes: 10 additions & 8 deletions after/ftplugin/json.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
vim.opt_local.autoindent = true
vim.opt_local.conceallevel = 0
vim.opt_local.expandtab = true
vim.opt_local.foldmethod = "syntax"
vim.opt_local.formatoptions = "tcq2l"
vim.opt_local.shiftwidth = 4
vim.opt_local.softtabstop = 4
vim.opt_local.tabstop = 8
local set = vim.opt_local

set.autoindent = true
set.conceallevel = 0
set.expandtab = true
set.foldmethod = "syntax"
set.formatoptions = "tcq2l"
set.shiftwidth = 4
set.softtabstop = 4
set.tabstop = 8
18 changes: 10 additions & 8 deletions after/ftplugin/jsonc.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
vim.opt_local.autoindent = true
vim.opt_local.conceallevel = 0
vim.opt_local.expandtab = true
vim.opt_local.foldmethod = "syntax"
vim.opt_local.formatoptions = "tcq2l"
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.tabstop = 4
local set = vim.opt_local

set.autoindent = true
set.conceallevel = 0
set.expandtab = true
set.foldmethod = "syntax"
set.formatoptions = "tcq2l"
set.shiftwidth = 2
set.softtabstop = 2
set.tabstop = 4
10 changes: 6 additions & 4 deletions after/ftplugin/make.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
vim.opt_local.expandtab = false
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.tabstop = 2
local set = vim.opt_local

set.expandtab = false
set.shiftwidth = 2
set.softtabstop = 2
set.tabstop = 2
7 changes: 7 additions & 0 deletions after/ftplugin/markdown.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
local set = vim.opt_local

set.cindent = true
set.expandtab = true
set.shiftwidth = 2
set.softtabstop = 2
set.tabstop = 2
20 changes: 11 additions & 9 deletions after/ftplugin/python.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
vim.opt_local.autoindent = true
vim.opt_local.cindent = true
vim.opt_local.copyindent = true
vim.opt_local.expandtab = true
vim.opt_local.smartindent = true
vim.opt_local.shiftwidth = 4
vim.opt_local.smarttab = true
vim.opt_local.softtabstop = 4
vim.opt_local.tabstop = 8
local set = vim.opt_local

set.autoindent = true
set.cindent = true
set.copyindent = true
set.expandtab = true
set.smartindent = true
set.shiftwidth = 4
set.smarttab = true
set.softtabstop = 4
set.tabstop = 8
16 changes: 9 additions & 7 deletions after/ftplugin/rust.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
vim.opt_local.commentstring = "//%s"
vim.opt_local.shiftwidth = 4
vim.opt_local.softtabstop = 4
vim.opt_local.smartindent = true
vim.opt_local.tabstop = 4
vim.opt_local.cindent = false
vim.opt_local.expandtab = true
local set = vim.opt_local

set.commentstring = "//%s"
set.shiftwidth = 4
set.softtabstop = 4
set.smartindent = true
set.tabstop = 4
set.cindent = false
set.expandtab = true
1 change: 0 additions & 1 deletion lua/core/event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ function autocmd.load_autocmds()
ft = {
{ "FileType", "*", "setlocal formatoptions-=cro" },
{ "FileType", "alpha", "setlocal showtabline=0" },
{ "FileType", "markdown", "setlocal wrap shiftwidth=2 tabstop=2" },
{ "FileType", "dap-repl", "lua require('dap.ext.autocompl').attach()" },
{
"FileType",
Expand Down

0 comments on commit 26123d2

Please sign in to comment.