Move nvim config to shared

This commit is contained in:
2024-06-08 14:14:26 -05:00
parent 4a914da23e
commit 0a8ded6db3
18 changed files with 278 additions and 24 deletions

View File

@@ -6,12 +6,7 @@ local plugins = {
'kylechui/nvim-surround', 'kylechui/nvim-surround',
{
'ibhagwan/fzf-lua', 'ibhagwan/fzf-lua',
config = function()
require('fzf-lua').setup({'skim'})
end
},
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
@@ -21,9 +16,9 @@ local plugins = {
'rust-lang/rust.vim', 'rust-lang/rust.vim',
{ {
'windwp/nvim-autopairs', 'windwp/nvim-autopairs',
event = 'InsertEnter', event = 'InsertEnter',
opts={}, opts={},
}, },
{ {

View File

@@ -35,6 +35,4 @@ vim.opt.completeopt=menuone,noselect
vim.opt.undofile=true vim.opt.undofile=true
vim.g['loaded_perl_provider']=0 vim.g['loaded_perl_provider']=0
vim.g['python3_host_prog']='/usr/bin/python'

View File

@@ -14,7 +14,8 @@
homeDirectory = "/home/eesim"; homeDirectory = "/home/eesim";
}; };
home.file.".config/nvim".source = ./dotfiles/nvim; home.file.".config/nvim".source = ../shared/dotfiles/nvim;
home.file.".tmux.conf".source = ../shared/dotfiles/tmux;
home.file.".config/waybar".source = ./dotfiles/waybar; home.file.".config/waybar".source = ./dotfiles/waybar;
home.file.".config/fish/config.fish".source = ./dotfiles/fish/config.fish; home.file.".config/fish/config.fish".source = ./dotfiles/fish/config.fish;

View File

@@ -6,12 +6,7 @@ local plugins = {
'kylechui/nvim-surround', 'kylechui/nvim-surround',
{
'ibhagwan/fzf-lua', 'ibhagwan/fzf-lua',
config = function()
require('fzf-lua').setup({'skim'})
end
},
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
@@ -20,15 +15,15 @@ local plugins = {
'L3MON4D3/LuaSnip', 'L3MON4D3/LuaSnip',
{ {
'windwp/nvim-autopairs', 'windwp/nvim-autopairs',
event = 'InsertEnter', event = 'InsertEnter',
opts = {}, opts = {},
}, },
{ {
'kaarmu/typst.vim', 'kaarmu/typst.vim',
ft = 'typst', ft = 'typst',
lazy = false, lazy = false,
}, },
'jalvesaq/Nvim-R', 'jalvesaq/Nvim-R',

View File

@@ -36,4 +36,3 @@ vim.opt.completeopt=menuone,noselect
vim.opt.undofile=true vim.opt.undofile=true
vim.g['loaded_perl_provider']=0 vim.g['loaded_perl_provider']=0
vim.g['python3_host_prog']='/usr/bin/python3'

View File

@@ -15,7 +15,7 @@
homeDirectory = "/home/eesim"; homeDirectory = "/home/eesim";
}; };
home.file.".config/nvim".source = ./dotfiles/nvim; home.file.".config/nvim".source = ../shared/dotfiles/nvim;
home.file.".config/waybar".source = ./dotfiles/waybar; home.file.".config/waybar".source = ./dotfiles/waybar;
home.file.".config/fish/config.fish".source = ./dotfiles/fish/config.fish; home.file.".config/fish/config.fish".source = ./dotfiles/fish/config.fish;
home.file.".config/alacritty/alacritty.toml".source = ./dotfiles/alacritty/alacritty.toml; home.file.".config/alacritty/alacritty.toml".source = ./dotfiles/alacritty/alacritty.toml;

View File

@@ -0,0 +1,9 @@
require('config/keymaps')
require('config/settings')
require('config/plugins')
require('config/plugins/lualine')
require('config/plugins/lspconfig')
local vimscriptpath = vim.fn.stdpath("config") .. "/lua/config/vimscript/"
vim.cmd('source' .. vimscriptpath .. 'init.vim')

View File

@@ -0,0 +1,17 @@
vim.g.mapleader=','
vim.g.maplocalleader=','
vim.keymap.set('n', '<C-h>', '<C-w>h')
vim.keymap.set('n', '<C-j>', '<C-w>j')
vim.keymap.set('n', '<C-k>', '<C-w>k')
vim.keymap.set('n', '<C-l>', '<C-w>l')
vim.keymap.set('n', '<leader>ff', ':FzfLua files<CR>')
vim.keymap.set('n', '<leader>fb', ':FzfLua buffers<CR>')
vim.keymap.set('n', '<leader>rg', ':FzfLua grep_project<CR>')
vim.keymap.set('i', '<S-Tab>', '<C-d>')
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)

View File

@@ -0,0 +1,53 @@
local plugins = {
'rebelot/kanagawa.nvim',
'nvim-lualine/lualine.nvim',
'kyazdani42/nvim-web-devicons',
'kylechui/nvim-surround',
'ibhagwan/fzf-lua',
'neovim/nvim-lspconfig',
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'L3MON4D3/LuaSnip',
{
'windwp/nvim-autopairs',
event = 'InsertEnter',
opts = {},
},
{
'kaarmu/typst.vim',
ft = 'typst',
lazy = false,
},
'jalvesaq/Nvim-R',
{
'RaafatTurki/hex.nvim',
config = function()
require('hex').setup()
end
},
}
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup(plugins, opts)

View File

@@ -0,0 +1,67 @@
local capabilities = require('cmp_nvim_lsp').default_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = false;
local lspconfig = require('lspconfig')
lspconfig.rust_analyzer.setup {
capabilities = capabilities,
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
},
imports = {
group = {
enable = false,
},
},
completion = {
postfix = {
enable = false,
},
},
},
},
}
lspconfig.omnisharp.setup {
cmd = { "dotnet", "/usr/lib/omnisharp-roslyn/OmniSharp.dll"}
}
local default_servers = {'pylsp', 'ccls', 'typst_lsp', 'r_language_server', 'lua_ls', 'nil_ls'}
for _, lsp in ipairs(default_servers) do
lspconfig[lsp].setup {
capabilities = capabilities
}
end
local luasnip = require 'luasnip'
local cmp = require 'cmp'
cmp.setup {
preselect = cmp.PreselectMode.None,
mapping = cmp.mapping.preset.insert({
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { 'i', 's' }),
}),
sources = {
{ name = 'nvim_lsp' },
{ name = 'path' },
},
}

View File

@@ -0,0 +1,36 @@
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'wombat',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {},
always_divide_middle = true,
globalstatus = true,
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {
lualine_a = {'buffers'},
lualine_b = {'branch'},
lualine_c = {'filename'},
lualine_x = {},
lualine_y = {},
lualine_z = {'tabs'}
},
extensions = {}
}

View File

@@ -0,0 +1,38 @@
vim.opt.cursorline=true
vim.opt.relativenumber=true
vim.opt.number=true
vim.opt.scrolloff=10
vim.opt.autoindent=true
vim.opt.expandtab=true
vim.opt.softtabstop=4
vim.opt.shiftwidth=4
vim.opt.shiftround=true
vim.opt.backspace={'indent','eol','start'}
vim.opt.hidden=true
vim.opt.laststatus=2
vim.opt.display='lastline'
vim.opt.showmode=true
vim.opt.showcmd=true
vim.opt.incsearch=true
vim.opt.ignorecase=true
vim.opt.smartcase=true
vim.opt.ttyfast=true
vim.opt.updatetime=300
vim.opt.splitright=true
vim.opt.wrapscan=true
vim.opt.report=0
vim.opt.list=true
vim.opt.completeopt=menuone,noselect
vim.opt.undofile=true
vim.g['loaded_perl_provider']=0

View File

@@ -0,0 +1,9 @@
filetype plugin indent on
syntax on
colorscheme kanagawa
if has('multi_byte') && &encoding ==# 'utf-8'
let &listchars = 'tab:▸ ,extends:,precedes:,nbsp:±'
else
let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.'
endif

View File

@@ -0,0 +1,20 @@
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
unbind-key '"'
unbind-key %
bind-key | split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r H resize-pane -L 5
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r L resize-pane -R 5

11
main.log Normal file
View File

@@ -0,0 +1,11 @@
[1717810556] Log start
[1717810556] Cmd: llama
[1717810556] main: build = 0 (unknown)
[1717810556] main: built with gcc (GCC) 13.2.0 for x86_64-unknown-linux-gnu
[1717810556] main: seed = 1717810556
[1717810556] main: llama backend init
[1717810556] main: load the model and apply lora adapter, if any
[1717810556] llama_model_load: error loading model: llama_model_loader: failed to load model from models/7B/ggml-model-f16.gguf
[1717810556] llama_load_model_from_file: failed to load model
[1717810556] main: error: unable to load model

6
overlays/llama-cpp.nix Normal file
View File

@@ -0,0 +1,6 @@
{}:
{
final: prev: {
llama-cpp = ;
}
}