Run stylua

master
Drake 2 years ago
parent 600b5ed107
commit 3c6fc1b28d

@ -1,29 +1,29 @@
vim.g.did_load_filetypes = 1 vim.g.did_load_filetypes = 1
--TODO: switch to a more lua friendly plugin manager --TODO: switch to a more lua friendly plugin manager
require("paq")({ require('paq')({
'savq/paq-nvim'; 'savq/paq-nvim',
'nathom/filetype.nvim'; 'nathom/filetype.nvim',
'neovim/nvim-lspconfig'; 'neovim/nvim-lspconfig',
'kyazdani42/nvim-web-devicons'; 'kyazdani42/nvim-web-devicons',
'nvim-lualine/lualine.nvim'; 'nvim-lualine/lualine.nvim',
'nvim-lua/plenary.nvim'; 'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim'; 'nvim-telescope/telescope.nvim',
'sainnhe/sonokai'; 'sainnhe/sonokai',
'nvim-treesitter/nvim-treesitter'; 'nvim-treesitter/nvim-treesitter',
'noib3/cokeline.nvim'; 'noib3/cokeline.nvim',
'andweeb/presence.nvim'; 'andweeb/presence.nvim',
'folke/todo-comments.nvim'; 'folke/todo-comments.nvim',
'dstein64/vim-startuptime'; 'dstein64/vim-startuptime',
{'nvim-telescope/telescope-fzf-native.nvim', run='make'}; { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
'echasnovski/mini.nvim'; 'echasnovski/mini.nvim',
'hrsh7th/nvim-cmp'; 'hrsh7th/nvim-cmp',
'hrsh7th/cmp-buffer'; 'hrsh7th/cmp-buffer',
'hrsh7th/cmp-nvim-lsp'; 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua'; 'hrsh7th/cmp-nvim-lua',
'hrsh7th/vim-vsnip'; 'hrsh7th/vim-vsnip',
'hrsh7th/cmp-vsnip'; 'hrsh7th/cmp-vsnip',
}) })
require("colorscheme") require('colorscheme')
require("config") require('config')
require("plugins") require('plugins')
require("keybinds") require('keybinds')

@ -2,14 +2,13 @@
local set = vim.opt local set = vim.opt
-- Set some stuff up like clipboard and mouse -- Set some stuff up like clipboard and mouse
set.termguicolors = true -- Needed for literally any modern colorscheme set.termguicolors = true -- Needed for literally any modern colorscheme
set.mouse = 'a' -- Mouse support set.mouse = 'a' -- Mouse support
set.clipboard = 'unnamedplus' -- Use X11 clipboard set.clipboard = 'unnamedplus' -- Use X11 clipboard
set.pumheight = 5 -- Uhh whatever the fuck this does set.pumheight = 5 -- Uhh whatever the fuck this does
set.number = true -- Show line numbers set.number = true -- Show line numbers
set.tabstop = 4 -- Set up tabs set.tabstop = 4 -- Set up tabs
set.shiftwidth = 4 -- See above set.shiftwidth = 4 -- See above
set.cursorline = false set.cursorline = false
-- Autocmds -- Autocmds

@ -1,14 +1,14 @@
local map = vim.api.nvim_set_keymap local map = vim.api.nvim_set_keymap
map('n', '<C-a>', 'ggVG', {noremap=true, silent=true}) map('n', '<C-a>', 'ggVG', { noremap = true, silent = true })
map('i', '<C-a>', '<Esc>ggVG', {noremap=true, silent=true}) map('i', '<C-a>', '<Esc>ggVG', { noremap = true, silent = true })
map('v', '<C-c>', 'y', {noremap=true, silent=true}) map('v', '<C-c>', 'y', { noremap = true, silent = true })
map('v', '<C-x>', 'd', {noremap=true, silent=true}) map('v', '<C-x>', 'd', { noremap = true, silent = true })
map('v', '<C-v>', 'p', {noremap=true, silent=true}) map('v', '<C-v>', 'p', { noremap = true, silent = true })
map('i', '<C-z>', '<Esc>ui', {noremap=true, silent=true}) map('i', '<C-z>', '<Esc>ui', { noremap = true, silent = true })
map('i', '<C-y>', '<Esc>:red<Enter>i', {noremap=true, silent=true}) map('i', '<C-y>', '<Esc>:red<Enter>i', { noremap = true, silent = true })
map('i', '<C-s>', '<Esc>:w<Enter>i', {noremap=true}) map('i', '<C-s>', '<Esc>:w<Enter>i', { noremap = true })
map('n', '<C-[>', '<Plug>(cokeline-focus-prev)', {noremap=false}) map('n', '<C-[>', '<Plug>(cokeline-focus-prev)', { noremap = false })
map('n', '<C-]>', '<Plug>(cokeline-focus-next)', {noremap=false}) map('n', '<C-]>', '<Plug>(cokeline-focus-next)', { noremap = false })
map('n', '<C-o>', '<CMD>Telescope find_files<CR>', {noremap=true}) map('n', '<C-o>', '<CMD>Telescope find_files<CR>', { noremap = true })
map('n', '<C-f>', '<CMD>Telescope live_grep<CR>', {noremap=true}) map('n', '<C-f>', '<CMD>Telescope live_grep<CR>', { noremap = true })
map('n', '<C-i>', '<CMD>lua require("FTerm").toggle()<CR>', {noremap=true, silent=true}) map('n', '<C-i>', '<CMD>lua require("FTerm").toggle()<CR>', { noremap = true, silent = true })

@ -15,74 +15,80 @@ local function filenameIfFileOpened()
end end
require('lualine').setup({ require('lualine').setup({
options = { options = {
icons_enabled = true, icons_enabled = true,
theme = 'sonokai', theme = 'sonokai',
component_separators = {left = '', right = ''}, component_separators = { left = '', right = '' },
section_separators = {left = '', right = ''}, section_separators = { left = '', right = '' },
disabled_filetypes = {} disabled_filetypes = {},
}, },
sections = { sections = {
lualine_a = {'mode'}, lualine_a = { 'mode' },
lualine_b = {'branch'}, lualine_b = { 'branch' },
lualine_c = {filenameIfFileOpened}, lualine_c = { filenameIfFileOpened },
lualine_x = {'fileformat'}, lualine_x = { 'fileformat' },
lualine_y = {'diff'}, lualine_y = { 'diff' },
lualine_z = {'filetype'} lualine_z = { 'filetype' },
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = {filenameIfFileOpened}, lualine_c = { filenameIfFileOpened },
lualine_x = {'location'}, lualine_x = { 'location' },
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {},
}, },
tabline = {}, tabline = {},
extensions = {} extensions = {},
}) })
-- Credit to the original author of cokeline for creating most of this config -- Credit to the original author of cokeline for creating most of this config
require('cokeline').setup({ require('cokeline').setup({
default_hl = { default_hl = {
focused = { focused = {
fg = get_hex('Normal', 'fg'), fg = get_hex('Normal', 'fg'),
bg = get_hex('Background', 'bg'), bg = get_hex('Background', 'bg'),
}, },
unfocused = { unfocused = {
fg = get_hex('Comment', 'fg'), fg = get_hex('Comment', 'fg'),
bg = get_hex('Background', 'bg'), bg = get_hex('Background', 'bg'),
}, },
}, },
components = { components = {
{ {
text = function(buffer) text = function(buffer)
if buffer.is_focused then if buffer.is_focused then
return '' .. buffer.devicon.icon return '' .. buffer.devicon.icon
else else
return '| ' .. buffer.devicon.icon return '| ' .. buffer.devicon.icon
end end
end, end,
hl = { hl = {
fg = function(buffer) return buffer.devicon.color end, fg = function(buffer)
}, return buffer.devicon.color
}, end,
{ },
text = function(buffer) return buffer.unique_prefix end, },
hl = { {
style = 'italic', text = function(buffer)
}, return buffer.unique_prefix
}, end,
{ hl = {
text = function(buffer) return buffer.filename .. ' ' end, style = 'italic',
}, },
{ },
text = 'X', {
delete_buffer_on_left_click = true, text = function(buffer)
}, return buffer.filename .. ' '
{ end,
text = ' ', },
}, {
}, text = 'X',
delete_buffer_on_left_click = true,
},
{
text = ' ',
},
},
}) })

@ -6,7 +6,7 @@ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
vim.fn['vsnip#anonymous'](args.body) vim.fn['vsnip#anonymous'](args.body)
end end,
}, },
mapping = { mapping = {
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
@ -17,38 +17,38 @@ cmp.setup({
else else
fallback() fallback()
end end
end end,
}, },
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'nvim_lua' }, { name = 'nvim_lua' },
{ name = 'vsnip' }, { name = 'vsnip' },
{ name = 'buffer' } { name = 'buffer' },
}) }),
}) })
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
require('lspconfig').clangd.setup({ require('lspconfig').clangd.setup({
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig').denols.setup({ require('lspconfig').denols.setup({
cmd = {'deno', 'lsp'}, cmd = { 'deno', 'lsp' },
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig').vls.setup({ require('lspconfig').vls.setup({
cmd = {'/usr/local/bin/vls'}, cmd = { '/usr/local/bin/vls' },
capabilities = capabilities capabilities = capabilities,
}) })
--TODO: clean this up --TODO: clean this up
local runtime_path = vim.split(package.path, ';') local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, 'lua/?.lua')
table.insert(runtime_path, "lua/?/init.lua") table.insert(runtime_path, 'lua/?/init.lua')
local sumneko_root_path = '/home/ruthenic/lua-language-server/bin/Linux/' local sumneko_root_path = '/home/ruthenic/lua-language-server/bin/Linux/'
require('lspconfig').sumneko_lua.setup({ require('lspconfig').sumneko_lua.setup({
cmd = {sumneko_root_path .. "lua-language-server", "-E", sumneko_root_path .. "main.lua"}, cmd = { sumneko_root_path .. 'lua-language-server', '-E', sumneko_root_path .. 'main.lua' },
settings = { settings = {
Lua = { Lua = {
runtime = { runtime = {
@ -56,16 +56,15 @@ require('lspconfig').sumneko_lua.setup({
path = runtime_path, path = runtime_path,
}, },
diagnostics = { diagnostics = {
globals = {'vim', 'use'}, globals = { 'vim', 'use' },
}, },
workspace = { workspace = {
library = vim.api.nvim_get_runtime_file("", true), library = vim.api.nvim_get_runtime_file('', true),
}, },
telemetry = { telemetry = {
enable = false, enable = false,
}, },
}, },
}, },
capabilities = capabilities capabilities = capabilities,
}) })

@ -1,16 +1,15 @@
require("filetype").setup { require('filetype').setup({
overrides = { overrides = {
extensions = {v = 'vlang'} extensions = { v = 'vlang' },
} },
} })
require('nvim-treesitter.configs').setup({
require('nvim-treesitter.configs').setup {
highlight = { highlight = {
enable = true, enable = true,
disable = {'lua'} disable = { 'lua' },
} },
} })
require('telescope').load_extension('fzf') require('telescope').load_extension('fzf')

Loading…
Cancel
Save