Compare commits

..

No commits in common. '551db07d8a1abb72ec232edbb6f51fbc9d3becb5' and '0125349dafdc895dadf621c2c2aebb9c46769990' have entirely different histories.

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

@ -1,37 +1 @@
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)
print("You are in Python")

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

@ -1,3 +1,5 @@
print("Configuring gitsigns")
local gitsigns = require('gitsigns')
gitsigns.setup {
@ -27,9 +29,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

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

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

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

@ -1,13 +1,11 @@
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.
-- I configure my terminal to set this environment variable.
if vim.env.NERD_FONTS then
vim.g.have_nerd_font = true
else
-- Set to true if you have a Nerd Font installed and selected in the terminal
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
@ -17,4 +15,3 @@ vim.g.loaded_netrwPlugin = 1
require("plugins")
require("prefs")
require("keys")
require("lsp")

@ -1,27 +1,25 @@
print("Loading up etc definitions")
local M = {}
local telescope = require("telescope.builtin")
-- cache directory checks for great speed
local work_tree_lookup_cache = {}
local is_inside_work_tree = {}
M.project_files = function()
local opts = {}
M.cwd_is_in_git_repo = function()
local cwd = vim.fn.getcwd()
if work_tree_lookup_cache[cwd] == nil then
if is_inside_work_tree[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
work_tree_lookup_cache[cwd] = vim.v.shell_error == 0
is_inside_work_tree[cwd] = vim.v.shell_error == 0
end
return work_tree_lookup_cache[cwd]
end
M.project_files = function()
local opts = {}
if M.cwd_is_in_git_repo() then
if is_inside_work_tree[cwd] 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")

@ -1,14 +0,0 @@
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 @@
vim.cmd [[packadd packer.nvim]]
print("Loading plugins")
local packer = require('packer')
vim.cmd [[packadd packer.nvim]]
function load_plugins(use)
return require('packer').startup(function(use)
-- the plugin that manages the plugins
use 'wbthomason/packer.nvim'
@ -43,14 +43,13 @@ function load_plugins(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
local plugins = packer.startup(load_plugins)
end)
return plugins

@ -1,3 +1,5 @@
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,8 +19,6 @@ 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 = {
@ -54,8 +52,4 @@ config.window_padding = {
bottom = -8,
}
config.set_environment_variables = {
NERD_FONTS = "1",
}
return config

Loading…
Cancel
Save