Setting up the Raspi: Difference between revisions

From wikiluntti
 
(19 intermediate revisions by the same user not shown)
Line 40: Line 40:
== Raspi and VIM ==
== Raspi and VIM ==


<syntaxhighlight>
Vim-nox is the (enhanced) minimal vi editor. Does not have a GUI, but includes the mouse support, but not the clipboard. Install vim and vim-nox.
sudo apt install vim
Some different vim plugin managers are
sudo apt install vim-nox
* vim-plug. Minimalist. Load plug.vim when vim starts (.vim/autoload). Instructions to install at https://www.linuxfordevices.com/tutorials/linux/vim-plug-install-plugins. Use the command :PlugInstall to install.
#Vundle
* vundle (updated 2019)
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
* pathogen
</syntaxhighlight>
* dein.vim
* volt
* janus
* minpac


<code>vim ~/.vimrc</code>
After updating .vimrc or my_configs.vim remember to source the file: :source %.
Some important thing in <code>vim ~/.vimrc</code>
* syntax enable
* set expandtab
* set tabstop=2
* set incsearch
* set hlsearch
* let mapleader=","
* set mouse=a """Mouse control


Two-column view: Ctrl-w v. The scrollbind is: set scrollbind. Command ^w l goes to new split, and also ^w arrows work.


Visual line wrapping: using gj you can move one visual line on screen if wrapped long lines are included. See https://vim.fandom.com/wiki/Move_cursor_by_display_lines_when_wrapping for a function to be inserted in .vimrc.


<syntaxhighlight>
Running '''Python''' on vim: https://stackoverflow.com/questions/18948491/running-python-code-in-vim. Set python autocomplete on vim: https://scribles.net/enabling-python-autocomplete-in-vim-on-raspberry-pi/.
" Syntax highlight
syntax enable
" Tabs are spaces
set expandtab
" Number of spaces per tab
set tabstop=2
" Search as soon as characters are entered
set incsearch
" Highlight search results
set hlsearch


</syntaxhighlight>
'''Latex''' on vim: I use vim-latex @ https://github.com/vim-latex/vim-latex. Use ''Plug 'https://github.com/vim-latex/vim-latex''' between ''call plug#begin()'' and ''call plug#end()'' and install with '':PlugInstall''. Beginners tutorial at http://vim-latex.sourceforge.net/documentation/latex-suite-quickstart/. Ctrl-j removes the trailing <> marks. F5 is the key insert environments and stuff but see the list at http://vim-latex.sourceforge.net/documentation/latex-suite/auc-tex-mappings.html for other commands. Folding of environments should be using <Leader>rf but I need to change the >Leader>. I use ''let mapleader=","'' to change mapleader to comma, this ,rf works for folding. zA or zR opens folds. References are handled with F9. Compile the document with <Leader>ll and view the dvi with <Leader>lv (didn't work everytime, but it opens the Document viewer (Evince) to the screen (not in to the vim).


https://stackoverflow.com/questions/18948491/running-python-code-in-vim
Manim


https://scribles.net/enabling-python-autocomplete-in-vim-on-raspberry-pi/
=== VIM ===


Bundle 'Valloric/YouCompleteMe'
Check <code>dib</code> or <code>di(</code> and <code>dab</code> and <code>ciw</code>.


=== Two column view===
https://vimdoc.sourceforge.net/htmldoc/motion.html#object-select
 
Press <code>Ctrl-w v</code>. The scroll bind can be set using <code>set scrollbind</code>.  
 
<code>^w l</code> to go to the new split, or use <code>^w arrow</code>.

Latest revision as of 20:02, 28 November 2024

Setting Up The Raspi

Establish Wifi, Bluetooth.

Credentials are pi@raspberrypi.local and raspberry. KiTTY seems to be a good terminal.

Set Up WiFi without Screen

Into root directory:

  • Add an empty file called ssh
  • Add a file wpa_supplicant.conf which includes
country=ee 
update_config=1
ctrl_interface=/var/run/wpa_supplicant GROUP=netdev
network={
    scan_ssid=1
    ssid="YOUR_NETWORK_NAME"
    psk="YOUR_PASSWORD"
    key_mgmt=WPA-PSK
}

Note the (Notepad++: Edit) EOL conversion UNIX.

https://www.raspberrypi-spy.co.uk/2017/04/manually-setting-up-pi-wifi-using-wpa_supplicant-conf/


USB cable // Perhaps requires Zero

Connect via usb to gadget mode. After flashing RaspianOS. The following files are at boot-directory

  • Modify config.txt: add dtoverlay=dwc2
  • Add an empty file called ssh
  • Edit cmdline.txt: Ensure that there exist rootwait modules-load=dwc2,g_ether.

Now you can ssh pi@raspberrypi.local if the usb cable is plugged in.


Raspi and VIM

Vim-nox is the (enhanced) minimal vi editor. Does not have a GUI, but includes the mouse support, but not the clipboard. Install vim and vim-nox. Some different vim plugin managers are

After updating .vimrc or my_configs.vim remember to source the file: :source %. Some important thing in vim ~/.vimrc

  • syntax enable
  • set expandtab
  • set tabstop=2
  • set incsearch
  • set hlsearch
  • let mapleader=","
  • set mouse=a """Mouse control

Two-column view: Ctrl-w v. The scrollbind is: set scrollbind. Command ^w l goes to new split, and also ^w arrows work.

Visual line wrapping: using gj you can move one visual line on screen if wrapped long lines are included. See https://vim.fandom.com/wiki/Move_cursor_by_display_lines_when_wrapping for a function to be inserted in .vimrc.

Running Python on vim: https://stackoverflow.com/questions/18948491/running-python-code-in-vim. Set python autocomplete on vim: https://scribles.net/enabling-python-autocomplete-in-vim-on-raspberry-pi/.

'Latex on vim: I use vim-latex @ https://github.com/vim-latex/vim-latex. Use Plug 'https://github.com/vim-latex/vim-latex between call plug#begin() and call plug#end() and install with :PlugInstall. Beginners tutorial at http://vim-latex.sourceforge.net/documentation/latex-suite-quickstart/. Ctrl-j removes the trailing <> marks. F5 is the key insert environments and stuff but see the list at http://vim-latex.sourceforge.net/documentation/latex-suite/auc-tex-mappings.html for other commands. Folding of environments should be using <Leader>rf but I need to change the >Leader>. I use let mapleader="," to change mapleader to comma, this ,rf works for folding. zA or zR opens folds. References are handled with F9. Compile the document with <Leader>ll and view the dvi with <Leader>lv (didn't work everytime, but it opens the Document viewer (Evince) to the screen (not in to the vim).

Manim

VIM

Check dib or di( and dab and ciw.

https://vimdoc.sourceforge.net/htmldoc/motion.html#object-select