fix bspwm screens, remove plug.vim and stdheader.vim from repo do download them from github
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
if [ -f $HOME/.config/bspwm/host.sh ];then /bin/sh $HOME/.config/bspwm/host.sh;fi
|
|
||||||
if [ -f $HOME/.config/bspwm/screenlayout.sh ];then /bin/sh $HOME/.config/bspwm/screenlayout.sh ;fi
|
if [ -f $HOME/.config/bspwm/screenlayout.sh ];then /bin/sh $HOME/.config/bspwm/screenlayout.sh ;fi
|
||||||
|
if [ -f $HOME/.config/bspwm/host.sh ];then /bin/sh $HOME/.config/bspwm/host.sh;fi
|
||||||
|
|
||||||
pgrep sxhkd > /dev/null || sxhkd &
|
pgrep sxhkd > /dev/null || sxhkd &
|
||||||
pgrep polybar >/dev/null || polybar -q main -c "$HOME/.config/polybar/config.ini"&
|
pgrep polybar >/dev/null || polybar -q main -c "$HOME/.config/polybar/config.ini"&
|
||||||
|
@ -3,12 +3,20 @@ source ~/.vimrc
|
|||||||
let mapleader=";"
|
let mapleader=";"
|
||||||
colorscheme vim
|
colorscheme vim
|
||||||
|
|
||||||
|
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
||||||
|
\| PlugInstall --sync
|
||||||
|
\| endif
|
||||||
|
|
||||||
call plug#begin('~/.config/nvim/plugged')
|
call plug#begin('~/.config/nvim/plugged')
|
||||||
Plug 'bling/vim-bufferline'
|
Plug 'bling/vim-bufferline'
|
||||||
Plug 'nvim-lua/plenary.nvim'
|
Plug 'nvim-lua/plenary.nvim'
|
||||||
Plug 'nvim-telescope/telescope.nvim'
|
Plug 'nvim-telescope/telescope.nvim'
|
||||||
|
Plug 'andweeb/presence.nvim'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
let g:user42 = 'tomoron'
|
||||||
|
let g:mail42 = 'tomoron@student.42angouleme.fr'
|
||||||
|
|
||||||
nnoremap <leader>ff <cmd>Telescope find_files<cr>
|
nnoremap <leader>ff <cmd>Telescope find_files<cr>
|
||||||
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
|
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
|
||||||
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
||||||
|
@ -1,150 +0,0 @@
|
|||||||
let s:asciiart = [
|
|
||||||
\" ::: ::::::::",
|
|
||||||
\" :+: :+: :+:",
|
|
||||||
\" +:+ +:+ +:+ ",
|
|
||||||
\" +#+ +:+ +#+ ",
|
|
||||||
\"+#+#+#+#+#+ +#+ ",
|
|
||||||
\" #+# #+# ",
|
|
||||||
\" ### ########.fr "
|
|
||||||
\]
|
|
||||||
let g:user42 = 'tomoron'
|
|
||||||
let g:mail42 = 'tomoron@student.42angouleme.fr'
|
|
||||||
let s:start = '/*'
|
|
||||||
let s:end = '*/'
|
|
||||||
let s:fill = '*'
|
|
||||||
let s:length = 80
|
|
||||||
let s:margin = 5
|
|
||||||
|
|
||||||
let s:types = {
|
|
||||||
\'\.c$\|\.h$\|\.cc$\|\.hh$\|\.cpp$\|\.hpp$\|\.php':
|
|
||||||
\['/*', '*/', '*'],
|
|
||||||
\'\.htm$\|\.html$\|\.xml$':
|
|
||||||
\['<!--', '-->', '*'],
|
|
||||||
\'\.js$':
|
|
||||||
\['//', '//', '*'],
|
|
||||||
\'\.tex$':
|
|
||||||
\['%', '%', '*'],
|
|
||||||
\'\.ml$\|\.mli$\|\.mll$\|\.mly$':
|
|
||||||
\['(*', '*)', '*'],
|
|
||||||
\'\.vim$\|\vimrc$':
|
|
||||||
\['"', '"', '*'],
|
|
||||||
\'\.el$\|\emacs$':
|
|
||||||
\[';', ';', '*'],
|
|
||||||
\'\.f90$\|\.f95$\|\.f03$\|\.f$\|\.for$':
|
|
||||||
\['!', '!', '/']
|
|
||||||
\}
|
|
||||||
|
|
||||||
function! s:filetype()
|
|
||||||
let l:f = s:filename()
|
|
||||||
|
|
||||||
let s:start = '#'
|
|
||||||
let s:end = '#'
|
|
||||||
let s:fill = '*'
|
|
||||||
|
|
||||||
for type in keys(s:types)
|
|
||||||
if l:f =~ type
|
|
||||||
let s:start = s:types[type][0]
|
|
||||||
let s:end = s:types[type][1]
|
|
||||||
let s:fill = s:types[type][2]
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:ascii(n)
|
|
||||||
return s:asciiart[a:n - 3]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:textline(left, right)
|
|
||||||
let l:left = strpart(a:left, 0, s:length - s:margin * 2 - strlen(a:right))
|
|
||||||
|
|
||||||
return s:start . repeat(' ', s:margin - strlen(s:start)) . l:left . repeat(' ', s:length - s:margin * 2 - strlen(l:left) - strlen(a:right)) . a:right . repeat(' ', s:margin - strlen(s:end)) . s:end
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:line(n)
|
|
||||||
if a:n == 1 || a:n == 11 " top and bottom line
|
|
||||||
return s:start . ' ' . repeat(s:fill, s:length - strlen(s:start) - strlen(s:end) - 2) . ' ' . s:end
|
|
||||||
elseif a:n == 2 || a:n == 10 " blank line
|
|
||||||
return s:textline('', '')
|
|
||||||
elseif a:n == 3 || a:n == 5 || a:n == 7 " empty with ascii
|
|
||||||
return s:textline('', s:ascii(a:n))
|
|
||||||
elseif a:n == 4 " filename
|
|
||||||
return s:textline(s:filename(), s:ascii(a:n))
|
|
||||||
elseif a:n == 6 " author
|
|
||||||
return s:textline("By: " . s:user() . " <" . s:mail() . ">", s:ascii(a:n))
|
|
||||||
elseif a:n == 8 " created
|
|
||||||
return s:textline("Created: " . s:date() . " by " . s:user(), s:ascii(a:n))
|
|
||||||
elseif a:n == 9 " updated
|
|
||||||
return s:textline("Updated: " . s:date() . " by " . s:user(), s:ascii(a:n))
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:user()
|
|
||||||
if exists('g:user42')
|
|
||||||
return g:user42
|
|
||||||
endif
|
|
||||||
let l:user = $USER
|
|
||||||
if strlen(l:user) == 0
|
|
||||||
let l:user = "marvin"
|
|
||||||
endif
|
|
||||||
return l:user
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:mail()
|
|
||||||
if exists('g:mail42')
|
|
||||||
return g:mail42
|
|
||||||
endif
|
|
||||||
let l:mail = $MAIL
|
|
||||||
if strlen(l:mail) == 0
|
|
||||||
let l:mail = "marvin@42.fr"
|
|
||||||
endif
|
|
||||||
return l:mail
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:filename()
|
|
||||||
let l:filename = expand("%:t")
|
|
||||||
if strlen(l:filename) == 0
|
|
||||||
let l:filename = "< new >"
|
|
||||||
endif
|
|
||||||
return l:filename
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:date()
|
|
||||||
return strftime("%Y/%m/%d %H:%M:%S")
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:insert()
|
|
||||||
let l:line = 11
|
|
||||||
|
|
||||||
" empty line after header
|
|
||||||
call append(0, "")
|
|
||||||
|
|
||||||
" loop over lines
|
|
||||||
while l:line > 0
|
|
||||||
call append(0, s:line(l:line))
|
|
||||||
let l:line = l:line - 1
|
|
||||||
endwhile
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:update()
|
|
||||||
call s:filetype()
|
|
||||||
if getline(9) =~ s:start . repeat(' ', s:margin - strlen(s:start)) . "Updated: "
|
|
||||||
if &mod
|
|
||||||
call setline(9, s:line(9))
|
|
||||||
endif
|
|
||||||
call setline(4, s:line(4))
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
return 1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:stdheader()
|
|
||||||
if s:update()
|
|
||||||
call s:insert()
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Bind command and shortcut
|
|
||||||
command! Stdheader call s:stdheader ()
|
|
||||||
map <F1> :Stdheader<CR>
|
|
||||||
autocmd BufWritePre * call s:update ()
|
|
File diff suppressed because it is too large
Load Diff
7
home.nix
7
home.nix
@ -6,7 +6,7 @@
|
|||||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2024/10/17 18:15:38 by tomoron #+# #+# #
|
# Created: 2024/10/17 18:15:38 by tomoron #+# #+# #
|
||||||
# Updated: 2024/10/18 01:47:08 by tomoron ### ########.fr #
|
# Updated: 2024/10/18 19:42:47 by tomoron ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
@ -17,6 +17,7 @@
|
|||||||
modules/git.nix
|
modules/git.nix
|
||||||
modules/picom.nix
|
modules/picom.nix
|
||||||
modules/alacritty.nix
|
modules/alacritty.nix
|
||||||
|
modules/vim.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
home.username = "${username}";
|
home.username = "${username}";
|
||||||
@ -43,11 +44,7 @@
|
|||||||
".config/sxhkd".source = lib.mkDefault dotfiles/config/sxhkd;
|
".config/sxhkd".source = lib.mkDefault dotfiles/config/sxhkd;
|
||||||
".config/polybar".source = dotfiles/config/polybar;
|
".config/polybar".source = dotfiles/config/polybar;
|
||||||
".config/nitrogen/wallpaper.png".source = lib.mkDefault dotfiles/config/nitrogen/wallpaper.png;
|
".config/nitrogen/wallpaper.png".source = lib.mkDefault dotfiles/config/nitrogen/wallpaper.png;
|
||||||
".config/nvim/init.vim".source = dotfiles/config/nvim/init.vim;
|
|
||||||
".config/nvim/plugin/stdheader.vim".source = dotfiles/config/nvim/plugin/stdheader.vim;
|
|
||||||
".local/share/nvim/site/autoload/plug.vim".source = dotfiles/local/share/nvim/site/autoload/plug.vim;
|
|
||||||
".xinitrc".source = dotfiles/xinitrc;
|
".xinitrc".source = dotfiles/xinitrc;
|
||||||
".vimrc".source = dotfiles/vimrc;
|
|
||||||
".bashrc".source = dotfiles/bashrc;
|
".bashrc".source = dotfiles/bashrc;
|
||||||
|
|
||||||
".local/share/rofi/themes".source = "${builtins.fetchGit {
|
".local/share/rofi/themes".source = "${builtins.fetchGit {
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
bspc monitor "HDMI-1-1" -d 1
|
||||||
|
bspc monitor "HDMI-0" -d 2 3
|
||||||
|
bspc monitor "DP-1-1" -d 4
|
||||||
|
bspc monitor "DP-0" -d 5
|
||||||
|
bspc desktop -f 2
|
||||||
|
@ -4,5 +4,6 @@
|
|||||||
imports = [ ./nitrogen.nix ];
|
imports = [ ./nitrogen.nix ];
|
||||||
home.file = {
|
home.file = {
|
||||||
".config/bspwm/screenlayout.sh".source = ./bspwm/screenlayout.sh;
|
".config/bspwm/screenlayout.sh".source = ./bspwm/screenlayout.sh;
|
||||||
|
".config/bspwm/host.sh".source = ./bspwm/host.sh;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
22
modules/vim.nix
Normal file
22
modules/vim.nix
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{config, lib, pkgs, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
home.file = {
|
||||||
|
".config/nvim/init.vim".source = ../dotfiles/config/nvim/init.vim;
|
||||||
|
".vimrc".source = ../dotfiles/vimrc;
|
||||||
|
|
||||||
|
#install plug.vim
|
||||||
|
".local/share/nvim/site/autoload/plug.vim".source = "${builtins.fetchGit {
|
||||||
|
url = "https://github.com/junegunn/vim-plug";
|
||||||
|
rev = "d80f495fabff8446972b8695ba251ca636a047b0";
|
||||||
|
ref = "master";
|
||||||
|
}}/plug.vim";
|
||||||
|
|
||||||
|
#install stdheader 42
|
||||||
|
".config/nvim/plugin/stdheader.vim".source = "${builtins.fetchGit {
|
||||||
|
url = "https://github.com/42Paris/42header";
|
||||||
|
rev = "9f51db5cc483951e257aece66f1f4ce3b14cdab1";
|
||||||
|
ref = "master";
|
||||||
|
}}/plugin/stdheader.vim";
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user