Compare commits

...

2 Commits

@ -1 +1,4 @@
print("You are in lua")
vim.opt_local.tabstop = 2
vim.opt_local.softtabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.expandtab = true

@ -1 +1,37 @@
print("You are in Python")
local has_pyright = nil
-- These are files that are typically located in the root directory of a Python
-- project
local root_files = {
'pyproject.toml',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile',
'pyrightconfig.json',
'.git',
}
local buf = vim.api.nvim_get_current_buf()
local root_dir = vim.fs.root(buf, root_files)
local git_dir = vim.fs.root(buf, {'.git'})
local lsp_server = vim.lsp.start({
name = 'pyright',
cmd = {'pyright-langserver', '--stdio'},
filetypes = { 'python' },
root_dir = root_dir,
single_file_support = false,
settings = {
python = {
analysis = {
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = 'openFilesOnly',
},
},
},
})
vim.lsp.buf_attach_client(buf, lsp_server)

@ -1,5 +1,3 @@
print("Setting up colors")
vim.g.jellybeans_use_term_italics = 1
local background = {}

@ -1,5 +1,3 @@
print("Configuring gitsigns")
local gitsigns = require('gitsigns')
gitsigns.setup {
@ -29,9 +27,9 @@ gitsigns.setup {
virt_text_priority = 100,
},
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
current_line_blame_formatter_opts = {
relative_time = false,
},
-- current_line_blame_formatter_opts = {
-- relative_time = false,
-- },
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default

@ -1 +0,0 @@
print("LSP setting up")

@ -1,5 +1,3 @@
print("After Telescope")
local telescope = require('telescope')
local builtin = require('telescope.builtin')

@ -1,6 +1,3 @@
print("Configuring Treesitter")
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"
ensure_installed = {

@ -1,11 +1,13 @@
print("Init start")
-- set leader to space
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal
-- Set to true if you have a Nerd Font installed and selected in the terminal.
-- I configure my terminal to set this environment variable.
if vim.env.NERD_FONTS then
vim.g.have_nerd_font = true
else
vim.g.have_nerd_font = false
end
-- for some reason vim-tree needs this to happen very early on and no I do not
-- know why
@ -15,3 +17,4 @@ vim.g.loaded_netrwPlugin = 1
require("plugins")
require("prefs")
require("keys")
require("lsp")

@ -1,25 +1,27 @@
print("Loading up etc definitions")
local M = {}
local telescope = require("telescope.builtin")
-- cache directory checks for great speed
local is_inside_work_tree = {}
M.project_files = function()
local opts = {}
local work_tree_lookup_cache = {}
M.cwd_is_in_git_repo = function()
local cwd = vim.fn.getcwd()
if is_inside_work_tree[cwd] == nil then
if work_tree_lookup_cache[cwd] == nil then
-- The directory has not been checked
vim.fn.system("git rev-parse --is-inside-work-tree")
-- Add the result to our cache
is_inside_work_tree[cwd] = vim.v.shell_error == 0
work_tree_lookup_cache[cwd] = vim.v.shell_error == 0
end
if is_inside_work_tree[cwd] then
return work_tree_lookup_cache[cwd]
end
M.project_files = function()
local opts = {}
if M.cwd_is_in_git_repo() then
telescope.git_files(opts)
else
telescope.find_files(opts)

@ -1,8 +1,8 @@
print("Loading key mappings")
local telescope = require('telescope.builtin')
local etc = require("etc")
vim.keymap.set('n', '<C-p>', etc.project_files, {})
vim.keymap.set('n', '<F2>', telescope.diagnostics, {})
vim.keymap.set('n', '<leader>o', telescope.buffers, {})
-- vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
-- vim.keymap.set("v", "K", ":m '>-2<CR>gv=gv")

@ -0,0 +1,14 @@
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
-- this code is run every time we attach an LSP
print("LSP Attached")
end,
})
vim.api.nvim_create_autocmd("LspDetach", {
callback = function(args)
-- this code runs every time a buffer detaches from an LSP
end,
})
-- vim.lsp.set_log_level(“DEBUG”)

@ -1,8 +1,8 @@
print("Loading plugins")
vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function(use)
local packer = require('packer')
function load_plugins(use)
-- the plugin that manages the plugins
use 'wbthomason/packer.nvim'
@ -43,13 +43,14 @@ return require('packer').startup(function(use)
}
-- a file browser
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
use { "nvim-tree/nvim-tree.lua" }
-- helps you configure lsp servers
use {
"neovim/nvim-lspconfig"
}
end)
end
local plugins = packer.startup(load_plugins)
return plugins

@ -1,5 +1,3 @@
print("Applying Preferences")
-- The character coding used within vim. I don't remember why I set this, to be
-- honest.
vim.opt.encoding = "utf-8"

@ -19,6 +19,8 @@ config.enable_tab_bar = true
-- hide the tab bar in windows that have only one tab
config.hide_tab_bar_if_only_one_tab = true
config.font = wezterm.font('JetBrains Mono', { weight = 'Bold' })
config.font_size = 14
config.launch_menu = {
@ -52,4 +54,8 @@ config.window_padding = {
bottom = -8,
}
config.set_environment_variables = {
NERD_FONTS = "1",
}
return config

Loading…
Cancel
Save