add filetype

This commit is contained in:
Ray Andrew 2023-12-08 15:59:48 -06:00
parent a28f5183d8
commit 6a069351f8
No known key found for this signature in database
GPG key ID: F5A608DC53934412
6 changed files with 217 additions and 107 deletions

View file

@ -1,5 +1,5 @@
{
"LuaSnip": { "branch": "master", "commit": "0df29db3543837f8b41597f2640397c5ec792b7b" },
"LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" },
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
"cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" },
"cloak.nvim": { "branch": "main", "commit": "ff5e746e787de14675396beb642bf5010b8bc96d" },
@ -8,57 +8,62 @@
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"copilot.vim": { "branch": "release", "commit": "998cf5ab1b85e844c7e8edb864a997e590df7182" },
"copilot.vim": { "branch": "release", "commit": "59c02393c99335392e9cb572cb47951bbb4de6be" },
"distant.nvim": { "branch": "v0.3", "commit": "998724f62386c8022a4e6c885f4509cf9477451a" },
"focus.nvim": { "branch": "master", "commit": "c83be53de558f6f0824c8cefcad61719c87ce157" },
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
"gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" },
"glow.nvim": { "branch": "main", "commit": "5b38fb7b6e806cac62707a4aba8c10c5f14d5bb5" },
"harpoon": { "branch": "master", "commit": "c1aebbad9e3d13f20bedb8f2ce8b3a94e39e424a" },
"indent-blankline.nvim": { "branch": "master", "commit": "9301e434dd41154ffe5c3d5b8a5c9acd075ebeff" },
"indent-blankline.nvim": { "branch": "master", "commit": "8a7b48f5823cc924f815129192288ec2e2b9288f" },
"lazy.nvim": { "branch": "main", "commit": "4c75c8eeb957a99aa44ce8e526c04340ab358c5e" },
"lsp-zero.nvim": { "branch": "v2.x", "commit": "589c0a9465b38f69d20c058a7b31788068afa48c" },
"lualine.nvim": { "branch": "master", "commit": "1a3f6bba410aff5a51bf8c84287aaa3a8ba30d0d" },
"mason-lspconfig": { "branch": "main", "commit": "e7b64c11035aa924f87385b72145e0ccf68a7e0a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "e7b64c11035aa924f87385b72145e0ccf68a7e0a" },
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
"mason-lspconfig": { "branch": "main", "commit": "09be3766669bfbabbe2863c624749d8da392c916" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "09be3766669bfbabbe2863c624749d8da392c916" },
"mason-null-ls.nvim": { "branch": "main", "commit": "ae0c5fa57468ac65617f1bf821ba0c3a1e251f0c" },
"mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
"mini.bufremove": { "branch": "main", "commit": "75be0b153b0cd2499c031e57d44cde8dad4766e4" },
"mini.comment": { "branch": "main", "commit": "2c7a512dad27e34a26d0f7d5d5bc2579f88167dc" },
"meh": { "branch": "master", "commit": "e2962284bbd53db5cbe2db39efaa3ea74ade0fb1" },
"mini.bufremove": { "branch": "main", "commit": "b0fb7c1f5e39a46bc008e73fb60e5dad39725a0a" },
"mini.comment": { "branch": "main", "commit": "e4320af992cd053a7da2f33d9f63a86c2ab6ce59" },
"nabla.nvim": { "branch": "master", "commit": "8c143ad2b3ab3b8ffbd51e238ccfcbd246452a7e" },
"neoconf.nvim": { "branch": "main", "commit": "c87c862a14a4c8c0e2bc823d304e4da472fd7180" },
"neodev.nvim": { "branch": "main", "commit": "24b403eabde652904077f84fd55441744e77a109" },
"neoconf.nvim": { "branch": "main", "commit": "ae08076a9d69721c99985b9e13fd6ba78767d280" },
"neodev.nvim": { "branch": "main", "commit": "b094a663ccb71733543d8254b988e6bebdbdaca4" },
"neorg": { "branch": "main", "commit": "073f04cdc5dc291f069935e36cdcd60927f67d5d" },
"neorg-telescope": { "branch": "main", "commit": "1310d4aaefd8149c9839bbe1d5610e94389e2f0e" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-bqf": { "branch": "main", "commit": "8784eebf34371049b641646d00232c2603215297" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-lspconfig": { "branch": "master", "commit": "e49b1e90c1781ce372013de3fa93a91ea29fc34a" },
"nvim-cmp": { "branch": "main", "commit": "d3a3056204e1a9dbb7c7fe36c114dc43b681768c" },
"nvim-lspconfig": { "branch": "master", "commit": "38da5bbe1eaab2394056109e48c7e195bdb8fdfe" },
"nvim-spectre": { "branch": "master", "commit": "696cff781a4a7ecc91549736835e2acbd00fe859" },
"nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" },
"nvim-treesitter": { "branch": "master", "commit": "9c4fc86b67c1d68141cef57846d24cbee9b74fb0" },
"nvim-treesitter-context": { "branch": "master", "commit": "82c695951612911421e8e21068ba5fc2c2e2c212" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "78c49ca7d2f7ccba2115c11422c037713c978ad1" },
"nvim-treesitter": { "branch": "master", "commit": "2f15204510000c144b841b775c5db91e39b4f38e" },
"nvim-treesitter-context": { "branch": "master", "commit": "8aa32aa6b84dda357849dbc0f775e69f2e04c041" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "eb208bfdfcf76efea0424747e23e44641e13aaa6" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" },
"nvim-ufo": { "branch": "main", "commit": "ebbab711d909d5f675e38ad489765bd22bd2c6b3" },
"nvim-web-devicons": { "branch": "master", "commit": "3af745113ea537f58c4b1573b64a429fefad9e07" },
"nvim-web-devicons": { "branch": "master", "commit": "f0267921c845c42685968401bc49aa65e18d3e09" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
"readline.nvim": { "branch": "master", "commit": "cab666cbd026dea9c817182e22255ecb3b3419b1" },
"refactoring.nvim": { "branch": "master", "commit": "bebfcfcc4b604d3647fcce2f4aeb02a95d139c49" },
"rasmus": { "branch": "main", "commit": "f824de95d446686e479781c0c2b778c177da528f" },
"refactoring.nvim": { "branch": "master", "commit": "5831194debd23920a32abd9fefd5dddba44e34fc" },
"rose-pine": { "branch": "main", "commit": "e29002cbee4854a9c8c4b148d8a52fae3176070f" },
"smart-splits.nvim": { "branch": "master", "commit": "c8a9173d70cbbd1f6e4a414e49e31df2b32a1362" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope.nvim": { "branch": "master", "commit": "74ce793a60759e3db0d265174f137fb627430355" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"trouble.nvim": { "branch": "main", "commit": "b9e713505457359d1d364ed41d5b1c7f81a6fe9c" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
"venn.nvim": { "branch": "main", "commit": "c114563960b8fb1197695d42798d1f3e7190b798" },
"vim-dispatch": { "branch": "master", "commit": "6cc2691576f97d43f8751664d1a1a908b99927e5" },
"vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" },
"vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" },
"vim-rsi": { "branch": "master", "commit": "45540637ead22f011e8215f1c90142e49d946a54" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" },
"vimtex": { "branch": "master", "commit": "cbb20643b7bfe721902dac5760bf0d4889fb5f7e" },
"which-key.nvim": { "branch": "main", "commit": "ce741eb559c924d72e3a67d2189ad3771a231414" },
"zen-mode.nvim": { "branch": "main", "commit": "cb73b8bd0ef9d765b942db09dc762c603a89ae44" }
}
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
"zen-mode.nvim": { "branch": "main", "commit": "50e2e2a36cc97847d9ab3b1a3555ba2ef6839b50" }
}

View file

@ -95,3 +95,11 @@ autocmd({ "BufWritePre" }, {
pattern = "*",
command = [[%s/\s\+$//e]],
})
-- vim.api.nvim_create_autocmd({ "WinNew", "WinClosed", "WinEnter" }, {
-- group = vim.api.nvim_create_augroup("on_demand_wrap", {}),
-- callback = function()
-- local should_wrap = vim.api.nvim_win_get_width(0) ~= vim.o.columns
-- vim.api.nvim_win_set_option(0, "wrap", should_wrap)
-- end,
-- })

View file

@ -0,0 +1,46 @@
-- using nvim autocommands
local autocmd = vim.api.nvim_create_autocmd
local augroup = require("rayandrew.util").augroup
local M = {}
function M.setup()
local group = augroup("filetype")
-- set tabs=4 and use tabs in txt files
autocmd("filetype", {
pattern = "text",
group = group,
callback = function()
vim.bo.tabstop = 4
vim.bo.softtabstop = 4
vim.bo.shiftwidth = 4
vim.bo.expandtab = false
vim.opt_local.wrap = true
end,
})
-- tex/latex wrap true
autocmd("filetype", {
pattern = "tex",
group = group,
callback = function()
vim.opt_local.wrap = true
vim.opt_local.breakindent = true
vim.opt_local.breakindentopt = "shift:2"
end,
})
autocmd("filetype", {
pattern = "latex",
group = group,
callback = function()
-- set wrap and breakindent
vim.opt_local.wrap = true
vim.opt_local.breakindent = true
vim.opt_local.breakindentopt = "shift:2"
end,
})
end
return M

View file

@ -6,6 +6,7 @@ function M.setup()
require("rayandrew.autocmds")
require("rayandrew.remap")
require("rayandrew.theme").setup()
require("rayandrew.filetype").setup()
-- require("rayandrew.statusline").setup()
end

View file

@ -301,6 +301,18 @@ return {
lazy = true,
},
{
"davidosomething/vim-colors-meh",
name = "meh",
lazy = true,
},
{
"kvrohit/rasmus.nvim",
name = "rasmus",
lazy = true,
},
------------------------------
-- File Management
------------------------------
@ -484,15 +496,11 @@ return {
main = "ibl",
event = { "BufReadPost", "BufNewFile" },
opts = {
indent = { char = "" },
scope = { enabled = true },
-- char = "▏",
indent = {
char = "",
},
exclude = {
buftypes = {
"terminal",
"nofile",
"quickfix",
"prompt",
},
filetypes = {
"help",
"alpha",
@ -506,7 +514,17 @@ return {
"lazyterm",
"qf",
},
buftypes = {
"terminal",
"nofile",
"quickfix",
"prompt",
},
},
scope = {
enabled = true,
},
-- show_trailing_blankline_indent = false,
},
},
@ -648,7 +666,7 @@ return {
-- stylua: ignore start
nmap("gd", function() vim.lsp.buf.definition() end, "Goto Definition")
nmap("<leader>ws", function() require('telescope.builtin').lsp_dynamic_workspace_symbols() end, "Workspace Symbol")
-- nmap("<leader>ws", function() require('telescope.builtin').lsp_dynamic_workspace_symbols() end, "Workspace Symbol")
nmap("<leader>ds", function() require('telescope.builtin').lsp_document_symbols() end, "Document Symbol")
nmap("<leader>df", function() vim.diagnostic.open_float() end, "Diagnostic Float")
nmap("gr", require("telescope.builtin").lsp_references, "Goto References")
@ -959,80 +977,83 @@ return {
-- RSI compatibility
{
"linty-org/readline.nvim",
event = "VeryLazy",
keys = {
{
"<M-f>",
function()
require("readline").forward_word()
end,
mode = "!",
},
{
"<M-b>",
function()
require("readline").backward_word()
end,
mode = "!",
},
{
"<M-d>",
function()
require("readline").kill_word()
end,
mode = "!",
},
{
"<M-BS>",
function()
require("readline").backward_kill_word()
end,
mode = "!",
},
{
"<C-w>",
function()
require("readline").unix_word_rubout()
end,
mode = "!",
},
{
"<C-k>",
function()
require("readline").kill_line()
end,
mode = "!",
},
{
"<C-u>",
function()
require("readline").backward_kill_line()
end,
mode = "!",
},
{
"<C-a>",
function()
require("readline").beginning_of_line()
end,
mode = "!",
},
{
"<C-e>",
function()
require("readline").end_of_line()
end,
mode = "!",
},
{ "<C-f>", "<Right>", mode = "!" }, -- forward-char
{ "<C-b>", "<Left>", mode = "!" }, -- backward-char
{ "<C-n>", "<Down>", mode = "!" }, -- next-line
{ "<C-p>", "<Up>", mode = "!" }, -- previous-line
{ "<C-d>", "<Delete>", mode = "!" }, -- delete-char
{ "<C-h>", "<BS>", mode = "!" }, -- backward-delete-char
},
"tpope/vim-rsi",
},
-- {
-- "assistcontrol/readline.nvim",
-- event = "VeryLazy",
-- keys = {
-- {
-- "<M-f>",
-- function()
-- require("readline").forward_word()
-- end,
-- mode = "!",
-- },
-- {
-- "<M-b>",
-- function()
-- require("readline").backward_word()
-- end,
-- mode = "!",
-- },
-- {
-- "<M-d>",
-- function()
-- require("readline").kill_word()
-- end,
-- mode = "!",
-- },
-- {
-- "<M-BS>",
-- function()
-- require("readline").backward_kill_word()
-- end,
-- mode = "!",
-- },
-- {
-- "<C-w>",
-- function()
-- require("readline").unix_word_rubout()
-- end,
-- mode = "!",
-- },
-- {
-- "<C-k>",
-- function()
-- require("readline").kill_line()
-- end,
-- mode = "!",
-- },
-- {
-- "<C-u>",
-- function()
-- require("readline").backward_kill_line()
-- end,
-- mode = "!",
-- },
-- {
-- "<C-a>",
-- function()
-- require("readline").beginning_of_line()
-- end,
-- mode = "!",
-- },
-- {
-- "<C-e>",
-- function()
-- require("readline").end_of_line()
-- end,
-- mode = "!",
-- },
-- { "<C-f>", "<Right>", mode = "!" }, -- forward-char
-- { "<C-b>", "<Left>", mode = "!" }, -- backward-char
-- { "<C-n>", "<Down>", mode = "!" }, -- next-line
-- { "<C-p>", "<Up>", mode = "!" }, -- previous-line
-- { "<C-d>", "<Delete>", mode = "!" }, -- delete-char
-- { "<C-h>", "<BS>", mode = "!" }, -- backward-delete-char
-- },
-- },
{
"tpope/vim-fugitive",
@ -1134,6 +1155,25 @@ return {
{
"github/copilot.vim",
init = function()
-- vim.g.copilot_no_tab_map = true
-- vim.g.copilot_assume_mapped = true
-- vim.g.copilot_tab_fallback = ""
vim.g.copilot_filetypes = {
["*"] = false,
["awk"] = true,
["lua"] = true,
["html"] = true,
["javascript"] = true,
["typescript"] = true,
["rust"] = true,
["c"] = true,
["c#"] = true,
["c++"] = true,
["go"] = true,
["python"] = true,
}
end,
},
{
@ -1537,4 +1577,12 @@ return {
{ "<leader>ck", desc = "AsyncStop" },
},
},
{
"chipsenkbeil/distant.nvim",
branch = "v0.3",
config = function()
require("distant"):setup()
end,
},
}

View file

@ -1,15 +1,17 @@
local M = {}
M.colorscheme = "rose-pine"
-- M.colorscheme = "rose-pine"
-- M.colorscheme = "meh"
M.colorscheme = "rasmus"
-- M.colorscheme = ""
function M.setup()
-- taken from https://github.com/LazyVim/LazyVim/blob/566049aa4a26a86219dd1ad1624f9a1bf18831b6/lua/lazyvim/config/init.lua#L117C3-L129C5
require("lazy.core.util").try(function()
if M.colorscheme == "" then
return
return
end
if type(M.colorscheme) == "function" then
M.colorscheme()
else