@@ -29,8 +29,8 @@ users make sure the `arduino` command is in your PATH.
29
29
## Platforms
30
30
31
31
vim-arduino should work with no special configuration on Linux and Mac. I have
32
- not tested on Windows, but have heard that it works via WSL. See # 4 for
33
- discussion.
32
+ not tested on Windows, but have heard that it works via WSL. See
33
+ [ this issue ] ( https://github.com/stevearc/vim-arduino/issues/4 ) for discussion.
34
34
35
35
## Configuration
36
36
@@ -79,19 +79,22 @@ endfunction
79
79
setl statusline=%!MyStatusLine()
80
80
```
81
81
82
- Or if you want something a bit fancier that includes serial port info:
82
+ This is my personal configuration (again, inside ` ftplugin/arduino.vim ` )
83
83
84
84
``` vim
85
85
" my_file.ino [arduino:avr:uno] [arduino:usbtinyisp] (/dev/ttyACM0:9600)
86
- function! MyStatusLine ()
86
+ function! ArduinoStatusLine ()
87
87
let port = arduino#GetPort()
88
- let line = '%f [' . g:arduino_board . '] [' . g:arduino_programmer . ']'
88
+ let line = '[' . g:arduino_board . '] [' . g:arduino_programmer . ']'
89
89
if !empty(port)
90
90
let line = line . ' (' . port . ':' . g:arduino_serial_baud . ')'
91
91
endif
92
92
return line
93
93
endfunction
94
- setl statusline=%!MyStatusLine()
94
+ augroup ArduinoStatusLine
95
+ autocmd! * <buffer>
96
+ autocmd BufWinEnter <buffer> setlocal stl=%f\ %h%w%m%r\ %{ArduinoStatusLine()}\ %=\ %(%l,%c%V\ %=\ %P%)
97
+ augroup END
95
98
```
96
99
Note: if you are using the 'airline' plugin for the status line, you can display
97
100
this custom status part instead of the filename extension with:
0 commit comments