update stuffz

This commit is contained in:
LordMZTE 2021-11-05 17:44:11 +01:00
parent c4eeb91e62
commit b0732cae2e
13 changed files with 433 additions and 519 deletions

View file

@ -1,3 +1,3 @@
require("plugins") require "plugins"
require("settings") require "settings"
require("maps") require "maps"

View file

@ -5,17 +5,17 @@ function escape_keycode(keycode)
end end
local function check_back_space() local function check_back_space()
local col = vim.fn.col(".") - 1 local col = vim.fn.col "." - 1
return col <= 0 or vim.fn.getline("."):sub(col, col):match("%s") return col <= 0 or vim.fn.getline("."):sub(col, col):match "%s"
end end
function tab_completion() function tab_completion()
if vim.fn.pumvisible() > 0 then if vim.fn.pumvisible() > 0 then
return escape_keycode("<C-n>") return escape_keycode "<C-n>"
end end
if check_back_space() then if check_back_space() then
return escape_keycode("<TAB>") return escape_keycode "<TAB>"
end end
return vim.fn["coc#refresh"]() return vim.fn["coc#refresh"]()
@ -23,9 +23,9 @@ end
function shift_tab_completion() function shift_tab_completion()
if vim.fn.pumvisible() > 0 then if vim.fn.pumvisible() > 0 then
return escape_keycode("<C-p>") return escape_keycode "<C-p>"
else else
return escape_keycode("<C-h>") return escape_keycode "<C-h>"
end end
end end

View file

@ -15,17 +15,17 @@ vim.g.coc_global_extensions = {
} }
local function check_back_space() local function check_back_space()
local col = vim.fn.col(".") - 1 local col = vim.fn.col "." - 1
return col <= 0 or vim.fn.getline("."):sub(col, col):match("%s") return col <= 0 or vim.fn.getline("."):sub(col, col):match "%s"
end end
function coc.tab_completion() function coc.tab_completion()
if vim.fn.pumvisible() > 0 then if vim.fn.pumvisible() > 0 then
return escape_keycode("<C-n>") return escape_keycode "<C-n>"
end end
if check_back_space() then if check_back_space() then
return escape_keycode("<TAB>") return escape_keycode "<TAB>"
end end
return vim.fn["coc#refresh"]() return vim.fn["coc#refresh"]()
@ -33,9 +33,9 @@ end
function coc.shift_tab_completion() function coc.shift_tab_completion()
if vim.fn.pumvisible() > 0 then if vim.fn.pumvisible() > 0 then
return escape_keycode("<C-p>") return escape_keycode "<C-p>"
else else
return escape_keycode("<C-h>") return escape_keycode "<C-h>"
end end
end end
@ -43,6 +43,6 @@ function coc.cr_completion()
if vim.fn.pumvisible() > 0 then if vim.fn.pumvisible() > 0 then
return vim.fn["coc#_select_confirm"]() return vim.fn["coc#_select_confirm"]()
else else
return escape_keycode([[\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>]]) return escape_keycode [[\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>]]
end end
end end

View file

@ -1,8 +1,8 @@
-- BASED OFF https://github.com/LoydAndrew/nvim/blob/main/evilline.lua -- BASED OFF https://github.com/LoydAndrew/nvim/blob/main/evilline.lua
local gl = require("galaxyline") local gl = require "galaxyline"
local gls = gl.section local gls = gl.section
local extension = require("galaxyline.provider_extensions") local extension = require "galaxyline.provider_extensions"
gl.short_line_list = { gl.short_line_list = {
"LuaTree", "LuaTree",
@ -83,7 +83,7 @@ local function get_coc_lsp()
end end
function get_diagnostic_info() function get_diagnostic_info()
if vim.fn.exists("*coc#rpc#start_server") == 1 then if vim.fn.exists "*coc#rpc#start_server" == 1 then
return get_coc_lsp() return get_coc_lsp()
end end
return "" return ""
@ -98,7 +98,7 @@ local function get_current_func()
end end
function get_function_info() function get_function_info()
if vim.fn.exists("*coc#rpc#start_server") == 1 then if vim.fn.exists "*coc#rpc#start_server" == 1 then
return get_current_func() return get_current_func()
end end
return "" return ""
@ -126,7 +126,7 @@ function has_file_type()
end end
local buffer_not_empty = function() local buffer_not_empty = function()
if vim.fn.empty(vim.fn.expand("%:t")) ~= 1 then if vim.fn.empty(vim.fn.expand "%:t") ~= 1 then
return true return true
end end
return false return false

View file

@ -1,7 +1,7 @@
local pears = require("pears") local pears = require "pears"
pears.setup(function(conf) pears.setup(function(conf)
conf.preset("tag_matching") conf.preset "tag_matching"
conf.on_enter(function(pears_handle) conf.on_enter(function(pears_handle)
if vim.fn.pumvisible() == 1 then if vim.fn.pumvisible() == 1 then

View file

@ -1,4 +1,4 @@
require("nvim-tree").setup({ require("nvim-tree").setup {
-- don't open tree when using firenvim -- don't open tree when using firenvim
open_on_setup = not vim.g.started_by_firenvim, open_on_setup = not vim.g.started_by_firenvim,
auto_close = true, auto_close = true,
@ -8,4 +8,4 @@ require("nvim-tree").setup({
view = { view = {
auto_resize = true, auto_resize = true,
}, },
}) }

View file

@ -1,4 +1,4 @@
require("telescope").setup({ require("telescope").setup {
defaults = { defaults = {
vimgrep_arguments = { vimgrep_arguments = {
"rg", "rg",
@ -10,4 +10,4 @@ require("telescope").setup({
"--smart-case", "--smart-case",
}, },
}, },
}) }

View file

@ -1,5 +1,5 @@
local configs = require("nvim-treesitter.configs") local configs = require "nvim-treesitter.configs"
local parsers = require("nvim-treesitter.parsers") local parsers = require "nvim-treesitter.parsers"
local parser_config = parsers.get_parser_configs() local parser_config = parsers.get_parser_configs()
@ -12,9 +12,9 @@ parser_config.haxe = {
filetype = "haxe", filetype = "haxe",
} }
configs.setup({ configs.setup {
ensure_installed = { "haxe" }, ensure_installed = { "haxe" },
highlight = { highlight = {
enable = true, enable = true,
}, },
}) }

View file

@ -1,80 +1,76 @@
vim.cmd([[packadd packer.nvim]]) vim.cmd [[packadd packer.nvim]]
local function pconf(plugin) local function pconf(plugin)
return 'require("pluginconf.' .. plugin .. '")' return 'require("pluginconf.' .. plugin .. '")'
end end
return require("packer").startup(function(use) return require("packer").startup(function(use)
use("wbthomason/packer.nvim") use "wbthomason/packer.nvim"
use({ use {
"neoclide/coc.nvim", "neoclide/coc.nvim",
branch = "release", branch = "release",
config = pconf("coc"), config = pconf "coc",
}) }
use("ryanoasis/vim-devicons") use "ryanoasis/vim-devicons"
use({ use {
"cespare/vim-toml",
branch = "main",
})
use({
"dracula/vim", "dracula/vim",
as = "dracula", as = "dracula",
}) }
use("vimwiki/vimwiki") use "vimwiki/vimwiki"
use({ use {
"glacambre/firenvim", "glacambre/firenvim",
run = function() run = function()
vim.fn["firenvim#install"](0) vim.fn["firenvim#install"](0)
end, end,
config = pconf("firenvim"), config = pconf "firenvim",
}) }
use("airblade/vim-gitgutter") use "airblade/vim-gitgutter"
use("dag/vim-fish") use "dag/vim-fish"
use("uiiaoo/java-syntax.vim") use "uiiaoo/java-syntax.vim"
use("honza/vim-snippets") use "honza/vim-snippets"
use("sheerun/vim-polyglot") use "sheerun/vim-polyglot"
use({ use {
"glepnir/galaxyline.nvim", "glepnir/galaxyline.nvim",
branch = "main", branch = "main",
config = pconf("galaxyline"), config = pconf "galaxyline",
}) }
use({ use {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
run = ":TSUpdate", run = ":TSUpdate",
config = pconf("treesitter"), config = pconf "treesitter",
}) }
use({ use {
"euclio/vim-markdown-composer", "euclio/vim-markdown-composer",
run = "cargo build --release", run = "cargo build --release",
config = pconf("markdowncomposer"), config = pconf "markdowncomposer",
}) }
use("kassio/neoterm") use "kassio/neoterm"
use("kyazdani42/nvim-web-devicons") use "kyazdani42/nvim-web-devicons"
use({ use {
"kyazdani42/nvim-tree.lua", "kyazdani42/nvim-tree.lua",
requires = "kyazdani42/nvim-web-devicons", requires = "kyazdani42/nvim-web-devicons",
config = pconf("nvimtree"), config = pconf "nvimtree",
}) }
use({ use {
"TimUntersberger/neogit", "TimUntersberger/neogit",
requires = "nvim-lua/plenary.nvim", requires = "nvim-lua/plenary.nvim",
}) }
use("ron-rs/ron.vim") use "ron-rs/ron.vim"
use({ use {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
requires = "nvim-lua/plenary.nvim", requires = "nvim-lua/plenary.nvim",
config = pconf("telescope"), config = pconf "telescope",
}) }
use("gluon-lang/vim-gluon") use "gluon-lang/vim-gluon"
use({ use {
"steelsojka/pears.nvim", "steelsojka/pears.nvim",
config = pconf("nvim_pears"), config = pconf "nvim_pears",
}) }
end) end)

View file

@ -4,7 +4,7 @@ local o = vim.o
local wo = vim.wo local wo = vim.wo
local g = vim.g local g = vim.g
cmd("syntax on") cmd "syntax on"
o.tabstop = 4 o.tabstop = 4
o.shiftwidth = 4 o.shiftwidth = 4
o.expandtab = true o.expandtab = true
@ -19,11 +19,11 @@ g.airline_powerline_fonts = 1
g.neoterm_default_mod = "tab" g.neoterm_default_mod = "tab"
g.neovide_iso_layout = true g.neovide_iso_layout = true
cmd("colorscheme dracula") cmd "colorscheme dracula"
-- Highlight the symbol and its references when holding the cursor. -- Highlight the symbol and its references when holding the cursor.
cmd("autocmd CursorHold * silent call CocActionAsync('highlight')") cmd "autocmd CursorHold * silent call CocActionAsync('highlight')"
cmd("autocmd StdinReadPre * let s:std_in=1") cmd "autocmd StdinReadPre * let s:std_in=1"
cmd("filetype plugin on") cmd "filetype plugin on"

View file

@ -1,84 +0,0 @@
local wezterm = require "wezterm"
local gitbash = {"C:\\Program Files\\Git\\bin\\bash.exe", "-i", "-l"}
return {
color_scheme = "Dracula",
default_prog = gitbash,
keys = {
{
key = "F3",
action = "ShowLauncher",
},
{
key = "Y",
mods = "CTRL",
action = "Copy",
},
{
key = "C",
mods = "CTRL",
action = "DisableDefaultAssignment",
},
{
key = " ",
mods = "CTRL|SHIFT",
action = "ActivateCopyMode",
},
{
key = "9",
mods = "ALT",
action = "DisableDefaultAssignment",
},
},
ssh_domains = {
{
name = "RPI",
remote_address = "192.168.2.5",
username = "pi",
}
},
font_dirs = {"C:\\Windows\\Fonts"},
font_rules = {
{
italic = false,
bold = false,
font = wezterm.font("Iosevka Nerd Font Complete"),
},
{
italic = true,
bold = false,
font = wezterm.font("Iosevka Italic Nerd Font Complete"),
},
{
italic = false,
bold = true,
font = wezterm.font("Iosevka Bold Nerd Font Complete"),
},
{
italic = true,
bold = true,
font = wezterm.font("Iosevka Bold Italic Nerd Font Complete"),
},
},
launch_menu = {
{
label = "Arch WSL",
args = {"wsl", "-d", "Arch"},
},
{
label = "Ubuntu WSL",
args = {"wsl", "-d", "Ubuntu-20.04"},
},
{
label = "Powershell",
args = {"powershell"},
},
{
label = "Git Bash",
args = gitbash,
},
},
}

2
stylua.toml Normal file
View file

@ -0,0 +1,2 @@
indent_type = "Spaces"
no_call_parentheses = true