Browse Source

Tue 19 Jul 2022 18:59:48 ACST

master
Tovi Jaeschke-Rogers 2 years ago
parent
commit
3c6eff64b5
5 changed files with 49 additions and 24 deletions
  1. +5
    -0
      .config/nvim/lua/general/autocmd.lua
  2. +4
    -2
      .config/nvim/lua/packer-plugins.lua
  3. +1
    -0
      .config/nvim/plugin/go.lua
  4. +15
    -22
      .config/nvim/plugin/packer_compiled.lua
  5. +24
    -0
      .config/nvim/plugin/treesitter.lua

+ 5
- 0
.config/nvim/lua/general/autocmd.lua View File

@ -2,6 +2,11 @@
-- Remove any trailing whitespace from the file on write
vim.api.nvim_create_autocmd({ 'BufWritePre' }, { command = [[%s/\s\+$//e]] })
vim.api.nvim_create_autocmd({ 'BufWritePre' }, {
pattern = { '*.go' },
callback = function () require('go.format').gofmt() end,
})
-- Load file on last line
-- TODO: change this to use lua
vim.api.nvim_create_autocmd({ 'BufRead' }, {


+ 4
- 2
.config/nvim/lua/packer-plugins.lua View File

@ -18,8 +18,10 @@ return require('packer').startup(function()
use 'dart-lang/dart-vim-plugin'
use { 'fatih/vim-go', cmd = 'GoUpdateBinaries' }
use { 'darrikonn/vim-gofmt', cmd = 'GoUpdateBinaries' }
use { 'nvim-treesitter/nvim-treesitter' }
use 'ray-x/go.nvim'
use 'ray-x/guihua.lua'
use 'aserowy/tmux.nvim'
end)

+ 1
- 0
.config/nvim/plugin/go.lua View File

@ -0,0 +1 @@
require('go').setup()

+ 15
- 22
.config/nvim/plugin/packer_compiled.lua View File

@ -84,11 +84,26 @@ _G.packer_plugins = {
path = "/home/tovi/.local/share/nvim/site/pack/packer/start/git-blame.nvim",
url = "https://github.com/f-person/git-blame.nvim"
},
["go.nvim"] = {
loaded = true,
path = "/home/tovi/.local/share/nvim/site/pack/packer/start/go.nvim",
url = "https://github.com/ray-x/go.nvim"
},
gruvbox = {
loaded = true,
path = "/home/tovi/.local/share/nvim/site/pack/packer/start/gruvbox",
url = "https://github.com/gruvbox-community/gruvbox"
},
["guihua.lua"] = {
loaded = true,
path = "/home/tovi/.local/share/nvim/site/pack/packer/start/guihua.lua",
url = "https://github.com/ray-x/guihua.lua"
},
["nvim-treesitter"] = {
loaded = true,
path = "/home/tovi/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
url = "https://github.com/nvim-treesitter/nvim-treesitter"
},
["packer.nvim"] = {
loaded = true,
path = "/home/tovi/.local/share/nvim/site/pack/packer/start/packer.nvim",
@ -123,32 +138,10 @@ _G.packer_plugins = {
loaded = true,
path = "/home/tovi/.local/share/nvim/site/pack/packer/start/tmux.nvim",
url = "https://github.com/aserowy/tmux.nvim"
},
["vim-go"] = {
commands = { "GoUpdateBinaries" },
loaded = false,
needs_bufread = true,
only_cond = false,
path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/vim-go",
url = "https://github.com/fatih/vim-go"
},
["vim-gofmt"] = {
commands = { "GoUpdateBinaries" },
loaded = false,
needs_bufread = true,
only_cond = false,
path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/vim-gofmt",
url = "https://github.com/darrikonn/vim-gofmt"
}
}
time([[Defining packer_plugins]], false)
-- Command lazy-loads
time([[Defining lazy-load commands]], true)
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file GoUpdateBinaries lua require("packer.load")({'vim-go', 'vim-gofmt'}, { cmd = "GoUpdateBinaries", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
time([[Defining lazy-load commands]], false)
if should_profile then save_profiles() end
end)


+ 24
- 0
.config/nvim/plugin/treesitter.lua View File

@ -0,0 +1,24 @@
require('nvim-treesitter.configs').setup {
-- A list of parser names, or "all"
ensure_installed = { 'go', 'dart' },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
auto_install = true,
-- List of parsers to ignore installing (for "all")
ignore_install = { "javascript" },
highlight = {
-- `false` will disable the whole extension
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}

Loading…
Cancel
Save